0

I'm not a bug expert hence y'all shouldn't yell at me if what I am about to say isn't what I should be saying. Here is the situation. I'm building a desktop windows form application in C# using VS 2010 Ultimatum. I added a new user control which contains a picture box that should display an image when some PropertyChangedEventHandler is fired. The application itself works as expected: No compilation error and when I run it, it does what it was meant to do. However VS is acting weird. Indeed, when I open the project in VS, it gives me this message: enter image description here

I thought maybe my VS installation is corrupted. I reinstalled it, and opened the project again but the same happens. Strangely, if I comment out some code that invoke the PropertyChangedEventHandler , then VS would start and work normally. Is this supposed to be a VS bug? After all, it should at least complain that my code isn't supported but it shouldn't crash just because I wrote some bad code. Besides, if my code compiles and works as expected, can someone please tell me what's wrong? P.S: Below is the details of the error as shown by VS. I'm looking to hear what you think.

Problem Event Name: CLR20r3 Problem Signature 01: devenv.exe Problem Signature 02: 10.0.30319.1 Problem Signature 03: 4ba1fab3 Problem Signature 04:<<<<<Hiden for privacy issues>>>>> (It is just the one the namespace where the error comes from! ) Problem Signature 05: 1.0.0.0 Problem Signature 06: 4f288861 Problem Signature 07: 25 Problem Signature 08: 1 Problem Signature 09: System.DllNotFoundException OS Version: 6.1.7600.2.0.0.256.4 Locale ID: 1033 Additional information about the problem: LCID: 1033 

I have also posted the same thread at MSDN forum

1
  • First, if it changes when you comment out some code, you should post the code that you're commenting out. Second, the problem is mentioned in the error details: Problem Signature 09: System.DllNotFoundException - something is trying to load a DLL that can't be found, probably because it's in a location that's not on the system PATH. It's probably something in the namespace (that you removed from your post). Check the references that your project uses (especially those that have anything to do with the code you're commenting out that remove the problem). Commented Feb 1, 2012 at 1:24

1 Answer 1

1

You need to disable PropertyChangedEventHandler from firing in Design mode.

If this is C#, it should look like this:

if(!this.DesignMode) { PropertyChanged(this, e); } 

If not that specifically, then disable whatever features might be causing the error from triggering in DesignMode.

Sign up to request clarification or add additional context in comments.

6 Comments

And where should this code be placed? In the Form constructor? or in the main function?
Where the event gets fired. If it's in a Custom User Control, put it there. If you made the event in the Form code, then put this in where the fired event's logic takes place. You just need to put this condition on the logic that is causing the problem.
I tried. It doesn't work at all. I have even stopped calling the event handler but it still doesn't work. Interestingly, if I just delete the function (which isn't called anywhere in my code), the VS works as expected!
What are you dealing with here? Where is this code coming from? A custom user control? Even if it's not happening in your code, the code that is being implemented might be calling it.
This is just my custom user control.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.