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

  • Home
  • SEARCH
  • 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 have a look at the following code import java.util.ArrayList; import java.util.List; public class
Please i need help, this code below works fine on my localhost, php5.3+ but
Please consider the following code: #include <iostream> #include <typeinfo> template< typename Type > void
Please take a look at this code (thanks to user budwiser), it matches a
Please find the below code , when i am rotating my simulator to landscape
Please see below code,i getting wrong value. eg; var FirstValue=0.00; var secondvalue=parseFloat(22.88,10).toFixed(2); var thirdvalue=(FirstValue)
Please have a look a the following code sample, executed on a Windows-32 system
Please have a look at the following code: <HTML> <HEAD> <script src=//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js type=text/javascript></script> <SCRIPT
Please read the code below and comments to see what I'm trying to do.
Please check out my fiddle. Why does the flash effect only happen on the

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.