Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 197707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:52:34+00:00 2026-05-11T16:52:34+00:00

Please humor me as I might be crazy. Does viewing xaml in the Visual

  • 0

Please humor me as I might be crazy.

Does viewing xaml in the Visual Studio UI designer execute the code-behind file?

For the past while whenever I try to view the main xaml file of my WPF application it throws an exception, but because I’ve been busy with other things I never really looked into it until today. Now I notice that in the exception’s call stack it’s calling many of the code-behind’s methods, including methods like Window_Loaded (!). It’s like it’s trying to run my application while I’m designing it and obviously failing.

So I’m also wondering why it does this.

I’m also wondering how exactly I’m supposed to debug this as it’s doing all this behind my back.

The actual exception comes from the fact that my application uses an unmanaged dll that it tries to use but somehow can’t find it for some reason.

[Edit]
I’ve tried moving my unmanaged DLL to Windows/System32, but I still get the same exception.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:52:34+00:00Added an answer on May 11, 2026 at 4:52 pm

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

    if (DesignerProperties.GetIsInDesignMode(this))
    {
       return;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please, provide code examples in a language of your choice. Update : No constraints
Please see the code below: #include <windows.h> int main(int argc, char* argv[]) { HANDLE
Please see the code here: http://pastie.org/1092106 When I call the method createPost on Blog,
Please, look at the following code that just convert an unsigned int to a
please tell me the code for setting an image as wallpaper in iphone.
Please have a look on code written below. I am trying to have a
Please is it possible to call up the system's file upload window with an
Please help me to understand below code. This is the script for drag and
Please can you tell me where I am wrong. I had a following code:
Please tell me whats wrong with this c# code.. public bool CloseCOMPort() { try

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.