c# - Viewing XAML file in the VisualStudio UI Designer executes the code behind file? -


Please make me laugh like I can go crazy.

Does the Visual Studio UI design the xaml code-back-file?

For the past, whenever I try to view the main xaml file of my WPF application, it throws an exception, but because I am busy in other things, which I have never really seen till date . Now I suppose that in the call stack of exceptions, this code is calling the many back-end methods, which include methods like window_logged (!). It seems that it is trying to run my application, while I I am designing and have failed clearly.

That's why I am also thinking why does this happen.

I am also wondering how to debug this, because it is doing all this behind my back.

The real exception comes from the fact that my application uses an unmanaged DLL which he tries to use, but in some way it can not be found for some reason.

[edit] I have tried to move my unmanaged DLL to Windows / System 32, but I still get the same exception.

Thank you!

Yes, there are things (like constructors) that evaluate at design time. If your code is throwing an exception in the designer, you can add it:

  if (DesignerProperties.GetIsInDesignMode (this)) {return; }  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -