This project is read-only.
0
Vote

NullReferenceException occurs within the VSXmlDesignerBase/Modeling.Sdk.Diagrams library

description

When modifying the model file by either moving the Entity, adding a new Entity/Association, VS comes up with an unhandled exception and crashes.
 
When debugging the stack trace only shows errors within the designer itself, the error being NullReferenceException. This can sometime co-incide with a error about key value cannot be null.
 
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.InvalidCastException' occurred in mscorlib.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Tools.VSXmlDesignerBase.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.XmlEditor.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Tools.XmlDesignerBase.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Tools.XmlDesignerBase.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Entity.Design.EntityDesigner.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Tools.XmlDesignerBase.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Entity.Design.EntityDesigner.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.Data.Entity.Design.EntityDesigner.dll
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.Modeling.Sdk.10.0.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll
A first chance exception of type 'System.NullReferenceException' occurred in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll

file attachments

comments

wrote Jan 4, 2012 at 5:26 AM

ALF - This happens frequently on my machine, after removing all custom properties it seems to work fine, it seems to only be a specific property that is causing the issue, possibly a typo or invalid declaration is causing the behaviour. Currently going through process of ellimination.

wrote Jan 4, 2012 at 6:27 AM

OK, so I can at least say which properties are causing it to fail (at least in my test cases)
 
They are:

ExplicitLoading
ImageName
IsAggregated
IsNavigational
Size
UseDefaultOptions
I don't know why as yet, but will investigate further and try and compare with working classes to see if there is anything that makes them special.

wrote Jan 6, 2012 at 1:57 AM

Associated with changeset 95173.

wrote Jan 6, 2012 at 2:00 AM

This issue technically is fixed, however the Default Values are now broken. Need to identify how to best perform Default Values.
 
Have these questions in the community to try and get some assistance
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/ddbfffcf-3871-427b-a9b9-0fb515169f06
http://stackoverflow.com/questions/8738156/ientitydesignerextendedproperty-is-causing-the-vsxmldesignerbase-to-throw-a-null
 
Hopefully we can get some suggestions on how to handle default values better, or how to stop VS from crashing by editing the XML at the point of the Getter (have also tried at the constructor and get the same problem).

wrote Feb 13, 2013 at 8:45 PM

wrote Sat at 5:15 PM