index > Visual Studio Team System - Domain-Specific Language Tools > Crash of visual studio when model is incorrect

Crash of visual studio when model is incorrect


We use team foundation server as a version tool for our DSL projects. However, since the debugging project runs only in the hive mode and the tfs-plugin is not available in the hive, it is clumbersome to keep the debugging project up to date.

If the DSL is changed and you do not have the latest debugging project, then visual studio crashes during start-up if an old model was open the previous time the debugging project was used. The work around is to remode the model(s) from the debugging project, and to recreate them or to obtain their corresponding versions.

I think the editor should give an error in the format of a message but a crash is rather drastic. My question is if you can also add some clue about what is wrong. This improves the backwards compatibility in a sence that at least you can try to fix the xml manually.

John Dekker

Hi John,

Which CTP are you using?

If it's the June one, then this is a bug if a malformed model file can crash VS.

If it is June and you're able to get us a call stack by attaching a debugger to that exp version of VS that would be useful.




Gareth Jones - Developer - DSL Tools & Software Factories Platform [MSFT]
GarethJ MSFT

Hi Gareth,

It is the june version. Getting the stack isn't that simple, but i will do my best.

John

John Dekker

Usually this is caused by unhandled exception thrown back into VS's load code. When managed exception gets thrown into unmanaged VS code, it often crashes VS. In June CTP, the error handling of generated serialization code was not very good, so handled exceptions may occur; in recent builds, we've fixed few load issues and the next release should be better at handling bad model files. But to be safe, it'll help if you can get a call stack, or if you can send us your model with the bad model file.

To make it easier to get the callstack, you can do this: in the debugged project, delete the Debugging.suo and Debugging.csproj.user files. This will cause no file to be opened automatically the next time you open the debugged project. Then in the debugging project, turn on catching all exceptions, and you should be able to see if any exception is thrown when you try to open the model file (after the debugged project is loaded). Thanks!




Frank Fan [MSFT]
Jing Fan

Thanx Jing,

I followed your suggestions. The exception thrown is:

+ $exception {"Domain object with identity f5ea6659-0cc0-471e-aa01-e3e486c3dbd6 was not found in directory."} System.Exception {Microsoft.VisualStudio.Modeling.DomainDataNotFoundException}

The show call stack is rather empty:

[External Code]
> Ordina.WebScenario.Designer.DslPackage.dll!Ordina.WebScenario.Designer.Ordina_WebScenario_DesignerExplorerBase.FindRootElements(Microsoft.VisualStudio.Modeling.Store store = {Microsoft.VisualStudio.Modeling.Store}) Line 70 + 0x34 bytes C#
[External Code]

The exception's callstack contains more info:

at Microsoft.VisualStudio.Modeling.DomainDataDirectory.GetDomainClass(Guid id)

at Microsoft.VisualStudio.Modeling.PartitionElementDirectory.FindElements(Guid domainClassId, Boolean includeDescendants)

at Microsoft.VisualStudio.Modeling.StoreElementDirectory.FindElements(Guid domainClassId, Boolean includeDescendants)

at Microsoft.VisualStudio.Modeling.StoreElementDirectory.FindElements(Guid domainClassId)

at Ordina.WebScenario.Designer.Ordina_WebScenario_DesignerExplorerBase.FindRootElements(Store store)

The code in the generated file ModelExplorer.cs is:

/// <summary>

/// Returns the root elements to be displayed in the explorer.

///</summary>

protected override global::System.Collections.IList FindRootElements(DslModeling::Store store)

{

return store.ElementDirectory.FindElements(global::Ordina.WebScenario.Designer.WebScenarioModel.DomainClassId);

}

I' am about to determine if the id is really not there.

John

John Dekker

The id referred to the root element (which naturally exists). When i removed the content of the element and the diagram, i was able to load the (empty) model again.

There seems to be no reason why the exception was thrown.

John Dekker
The exception you got typically happens when LoadDomainModel() is not called correctly. By default, if you create a Store, it has no DomainModel loaded; you need to call LoadDomainModel() to load the domain models you want to use in that store. Please double-check to see if this is causing the problem. Thanks!


Frank Fan [MSFT]
Jing Fan

Hi Jing,

That can not be the case, since the model is loaded normally by double click on the model in the solution explorer. There is no special loading algorithm written by me.

John

John Dekker
reply 8

You can use google to search for other answers

 

More Articles

How to wrap words of one single line to multiple lines that fit i...
How do I get a new ModelElement's corresponding Shape?
Announcing DSL Tools May 2005 CTP for Visual Studio 2005 Beta 2
How to reliably identify a new loaded model in a shared store
Cannot add Reference shape to DSL Diagram
Custom TargetEndStyle
How to Prevent property from being displayed in Concepts Properti...
geometryShape no "Diamond" Shape possible
Popup dialog in DSL
How to move shapes within diagram programmatically???
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Error creating DSL setup project (empty …
Licensing & pricing
Custom rules
Domain model designer
Serialize reference type class member
Feedback
diagram.AutoLayoutChildShapes(???)
Transitions shapes not draggable/Package…
Using DSL tools outside VS
How to use a developed DSL?
CompartmentShapeMap
How it the class mentioned in directivep…
DSL and visual studio
Adding files generated with text templat…
some question In DSL Tools

Hot Articles

Problem starting new DSL-project
Codegen templates selected at build time
diagram.AutoLayoutChildShapes(???)
Toolswindows out of control.
Using existing Enumerations
Comments and CommentShapes
Suggestion - Context Menu: Override Beha…
Beginner question about the use of DSL T…
Slip in schedule
How-to: create a custom tool that runs d…
Installing June 2006 VS SDK CTP side-by-…
Clarifying terms
Dynamically generate and "install&q…
How to know if OnShapeInserted was initi…
protected internal

Recommend Articles

Custom Geometry Shape
Template Fix: Text templating fails with…
How to remove non application menu-items…
Default values not stored
Relationship representation
Package Load Failure with /NoVsip
How to set the connector decorator posit…
how can i get a reference to a modelelem…
DSL and visual studio
How to set compartment's default expande…
Reading and writing models in June relea…
Changing Role Players in the Properties …
Enable/Disable property OnValueChanging/…
Domain model designer toolbox items disa…
constrain the number of a specific shape