Hi, All
I have a user control, ControlA, which has specifically been marked as NOT DesktopCompatible. This works fine, normally. If I drag this control onto a Windows Form in designer, I get that "placeholder" control, indicating that the control is not desktop compatible.
I have another user control, ControlB, which I have also specifically marked as NOT DesktopCompatible (It actually IS compatible, except that it contains ControlA). In the designer of ControlB, the behaviour is correct, and ControlA displays as a "placeholder". However, when I try and add ControlB to a Windows Form in designer (Or open a form that contains ControlB), Visual Studio crashes, complaining about how it cannot find coredll.dll.
I have two possible solutions:
- How can I get the designer to respect the DesktopCompatible(false) attribute of ControlB, so that it doesn't try to invoke the internal P/Invoke calls from ControlA?
- Since I have access to the source code of both ControlA and ControlB, I could make both controls DesktopCompatible by wrapping any P/Invoke calls in #if design preprocessor directives. But this is not working!
How do I get C# to know if code is running in designtime or not?
Cheers
Graham
Visit
http://www.communicate.za.net/ and talk about anything but work! Well... I suppose if you really HAVE to talk about work...