Debugging Security exceptions
I have a winforms control embedded in an html page with an object tag. It often fails to load for no apparent reason. My solution consists of two dll's (SimpleControl and otherlib). Otherlib is statically linked to SimpleControl.dll. The application (SimpleControl.dll, Otherlib.dll, SimpleControl.config, index.html) have been put into an IIS virtual directory SimpleControl. Both dll's are strongly signed and the SimpleControl.dll has its AllowPartiallyTrustedCallers attribute set.
Sometimes when I deploy the application the control doesn't load, I just get an empty slot where the control should've been. I suspect in most cases it's a security exception, but how can I tell? I set System.Diagnostics.Debugger.Break() call to attach the debugger, it doesn't get hit.
My IIS log shows:
18:51:08 127.0.0.1 GET /SimpleControl/index.htm 200
18:51:08 127.0.0.1 GET /SimpleControl/SimpleControl.dll 200
18:51:08 127.0.0.1 GET /SimpleControl/SimpleControl.config 200
critically otherlib.dll wasn't requested
Fuslogvw doesn't show any binding failures. If I set fuslogvw to log all activity (via regkey HKLM\Software\Microsoft\Fusion\ForceLog registry value to 1 (the value is a DWORD)), all I can see is that it didn't attempt to bind otherlib.
Are there any log files I'm missing? Is there some way to get IE/the CLR to log more of whats going on?
If there is no better tool at the moment, would Microsoft considering adding something?
Thanks
Mark -- in the security exception abyss
In this case the problem turned out to be a Security exception - I invoked AppDomain.GetCurrentThreadId() - which isn't documented to have an exception

