|
-
February 8th, 2005, 04:06 PM
#3
Re: StrongNameIdentityPermission issue
Thanks for the quick reply. I thought I had tried LinkDemand, but obviously didn't in the final form of the app. It does indeed allow the test app form to execute correctly.
Which begs the question of why Demand doesn't work for a form but does on a console app. Obviously, there is something in the stack that doesn't have access, but what is it?
The StackTrace for the console app shows:
StackTrace.GetFrame(0).GetMethod().Name: Main
StackTrace.GetFrame(0).GetMethod().ReflectedType.AssemblyQualifiedName: StrongNameTestConsoleApp.Class1
The StackTrace for the form shows:
StackTrace.GetFrame(0).GetMethod().Name: btnStaticTest_Click
StackTrace.GetFrame(0).GetMethod().ReflectedType.AssemblyQualifiedName: StrongNameTestForm.Form1
StackTrace.GetFrame(1).GetMethod().Name: OnClick
StackTrace.GetFrame(1).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Control
StackTrace.GetFrame(2).GetMethod().Name: OnClick
StackTrace.GetFrame(2).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Button
StackTrace.GetFrame(3).GetMethod().Name: OnMouseUp
StackTrace.GetFrame(3).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Button
StackTrace.GetFrame(4).GetMethod().Name: WmMouseUp
StackTrace.GetFrame(4).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Control
StackTrace.GetFrame(5).GetMethod().Name: WndProc
StackTrace.GetFrame(5).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Control
StackTrace.GetFrame(6).GetMethod().Name: WndProc
StackTrace.GetFrame(6).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.ButtonBase
StackTrace.GetFrame(7).GetMethod().Name: WndProc
StackTrace.GetFrame(7).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Button
StackTrace.GetFrame(8).GetMethod().Name: OnMessage
StackTrace.GetFrame(8).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Control+ControlNativeWindow
StackTrace.GetFrame(9).GetMethod().Name: WndProc
StackTrace.GetFrame(9).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Control+ControlNativeWindow
StackTrace.GetFrame(10).GetMethod().Name: DebuggableCallback
StackTrace.GetFrame(10).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.NativeWindow
StackTrace.GetFrame(11).GetMethod().Name: DispatchMessageW
StackTrace.GetFrame(11).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.UnsafeNativeMethods
StackTrace.GetFrame(12).GetMethod().Name: System.Windows.Forms.UnsafeNativeMethods+IMsoComponentManager.FPushMessageLoop
StackTrace.GetFrame(12).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Application+ComponentManager
StackTrace.GetFrame(13).GetMethod().Name: RunMessageLoopInner
StackTrace.GetFrame(13).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Application+ThreadContext
StackTrace.GetFrame(14).GetMethod().Name: RunMessageLoop
StackTrace.GetFrame(14).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Application+ThreadContext
StackTrace.GetFrame(15).GetMethod().Name: Run
StackTrace.GetFrame(15).GetMethod().ReflectedType.AssemblyQualifiedName: System.Windows.Forms.Application
StackTrace.GetFrame(16).GetMethod().Name: Main
StackTrace.GetFrame(16).GetMethod().ReflectedType.AssemblyQualifiedName: StrongNameTestForm.Form1
Anyway. When using strong names with windows applications use SecurityAction.LinkDemand or be prepared to dig deeper.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|