Mark Levison

Musings on No Touch Deployment, .NET development and photography

<May 2008>
SuMoTuWeThFrSa
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567


Navigation

Other

Blogroll

Subscriptions

Post Categories



Friday, January 14, 2005 - Posts

Debugging Exceptions in the WinForms designer
Matthew Adams co-author of Windows Forms in a Nutshell has just start a blog. His 2nd entry "What has the designer done now" has some excellent tips on working with the designer. My favourite is:

You can build a control that has an implementation bug that causes an exception at deisgn time. Everything will build fine, but when you reopen the designer you'll see the exception text.
...
Fixing it can be tricky. If inspection doesn't work, a handy tip is to open a second IDE, and attach to the original instance of VS.NET. You can then set some breakpoints in your control and watch what happens as you open the designer.

Sweet - I occasionally encounter this problems - usually when I've split a common base class out of several forms. No finally I can try to debug them. Thanks Matthew.

posted Friday, January 14, 2005 1:26 PM by mlevison with 0 Comments

BeginInvoke() another undocumented Security requirement

Earlier today I got myself into a little trouble, I had been calling BeginInvoke() to act as a PostMessage() to display a new object only after its parent had been created.  When running under full trust this worked very well, however as soon as someone (not I oops) tested in the default internet trust - Boom a security exception.  It turns out that BeginInvoke() calls MarshaledInvoke() which eventually calls CompressedStack.GetCompressedStack() which has a link demand for Unmanaged code. Unsurprisingly code deployed from the internet doesn't get this permission by default.

posted Friday, January 14, 2005 12:51 PM by mlevison with 0 Comments




Powered by Dot Net Junkies, by Telligent Systems