Two of my users (out of several thousand) have run into a weird exception when my app starts. I haven't been able to find any useful information about it via Google, MSDN or Reflector.
In case you want to copy paste this stuff, here's it written out:
External component has thrown an exception.
Stack trace:
at System.Security.CodeAccessSecurityEngine.CheckNReturnSO(PermissionToken permToken, CodeAccessPermission demand, StackCrawlMark& stackMark, Int32 unrestrictedOverride, Int32 create)
at System.Security.SecurityRuntime.Assert(PermissionSet permSet, StackCrawlMark& stackMark)
at System.Security.PermissionSet.Assert()
at System.Windows.Forms.WindowsFormsSynchronizationContext.InstallIfNeeded()
at System.Winfows.Forms.Control..ctor(Boolean autoInstallSyncContext)
.....
at GrasshopperPlugin.GrasshopperPlugin.OnLoadPlugIn() //This is the first call to my assembly.
at RhDN_NativePlugInBase<CRhinoUtilityPlugIn,RMA::Rhino::MRhinoUtilityPlugIn>.OnLoadPlugIn() //This is the C++/CLI mixed mode SDK that loads my .NET assembly.
What does it mean? Why does it happen? How can I fix/detect this?