Click here to Skip to main content
15,893,594 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i don't know what change i made that caused my program not to work anymore. when running it say:
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.dll
Additional information: The invocation of the constructor on type 'gis.GISViewModel' that matches the specified binding constraints threw an exception. [Line: 12 Position: 33]

in the xaml, the location is where i instantiate from view model. it seems that i can't instantiate from view model, because when i created an instance in code-behind it also raised an exception.
i thought it might be because i separated view model class in more than one source file and used partial keyword for it. but when i rejoined the files i got no change.
any clue?
thx
Posted
Updated 12-Mar-12 1:53am
v3

1 solution

Here are my suggestions that you could try:

1.Check if you have enabled unmanaged debugging (in Project Properties -> Debug)
2.Find out if there are any dependencies your C++/CLI DLL where the Winforms control is implemented and if those dependencies cannot be resolved.
In order to find out dependencies on native DLLs, you should use the tool Dependency Walker (depends.exe). .NET Reflector will only examine managed dependencies.
3.Comment out code of your User Control step by step and try again.
4.Use Gflags.exe to turn on Loader Snaps
 
Share this answer
 
Comments
ilostmyid2 13-Mar-12 0:27am    
hithank u for replying. i think ur an expert in C#. i will keep ur advice in mind.
i found the source of the problem. indeed step 3 is a good solution. the problem was with a data member initialization. it was of type Size and for i can realize that it's not still assigned i'd initialized its width with -1. this would cause exception because it didn't expect that a Size.Width get negative! :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900