Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null Reference Exception while creating bidirectional association #108

Open
MartinJSoles opened this issue Aug 6, 2024 · 0 comments
Open

Comments

@MartinJSoles
Copy link

When I attempt to create a bidirectional association in VS2022 Pro (17.10.5), the designer throws a null reference exception and crashes VS.

I opened a second VS and debugged the first to capture the stack trace:

   at Sawczyn.EFDesigner.EFModel.AssociationAddRules.ElementAdded(ElementAddedEventArgs e) in D:\Code\EFDesigner2022\src\Dsl\CustomCode\Rules\AssociationAddRules.cs:line 53
   at Microsoft.VisualStudio.Modeling.AddRuleNotification.DoFireRule()
   at Microsoft.VisualStudio.Modeling.RuleNotification.FireRule()
   at Microsoft.VisualStudio.Modeling.RuleManager.FireAddRule(Transaction txn, ElementAddedEventArgs eventArgs)
   at Microsoft.VisualStudio.Modeling.RuleManager.ElementAdded(Transaction txn, AddElementLinkCommand addLinkCmd)
   at Microsoft.VisualStudio.Modeling.AddElementLinkCommand.NotifyRule()
   at Microsoft.VisualStudio.Modeling.Transaction.AddCommand(ModelCommand command)
   at Microsoft.VisualStudio.Modeling.ElementLink..ctor(Partition partition, RoleAssignment[] roleAssignments, PropertyAssignment[] propertyAssignments)
   at Sawczyn.EFDesigner.EFModel.BidirectionalAssociation..ctor(ModelClass source, ModelClass target) in D:\Code\EFDesigner2022\src\Dsl\GeneratedCode\DomainRelationships.cs:line 3889
   at Sawczyn.EFDesigner.EFModel.BidirectionalAssociationBuilder.ConnectModelClassToModelClass(ModelClass sourceAccepted, ModelClass targetAccepted) in D:\Code\EFDesigner2022\src\Dsl\CustomCode\Connection Builders\BidirectionalAssociationBuilder.cs:line 150
   at Microsoft.VisualStudio.Modeling.Diagrams.ConnectAction.CreateConnection()
   at Microsoft.VisualStudio.Modeling.Diagrams.ConnectAction.OnClicked(MouseActionEventArgs e)
   at Microsoft.VisualStudio.Modeling.Diagrams.MouseAction.InvokeStateChangeMethods(MouseActionState oldState, MouseActionState newState, DiagramClientView diagramClientView, ActionRequest nextAction)
   at Microsoft.VisualStudio.Modeling.Diagrams.MouseAction.FlushInternalEventQueue()
   at Microsoft.VisualStudio.Modeling.Diagrams.DiagramClientView.OnMouseUp(MouseEventArgs e)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at Microsoft.VisualStudio.Modeling.Diagrams.DiagramClientView.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Oddly enough, when I added associations with the debugger attached, I was able to create a couple of associations before getting the exception thrown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant