[02/03] New strong naming issue
Ok I have most of my kinks worked out with strong naming my assemblies, creating a key for my classes to use, and getting it all working.
The issue I am having is at design time. Any of my custom controls don't show up on the form designer after I put in the public key that they need to run.
I get an error in the IDE
Quote:
An exception occurred while trying to create an instance of My Control Name Here. The exception was "Request for the permission of type System.Security.Permissions.StrongNameIdentityPermission, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.".
However things run fine at runtime, and compile fine as well. It is only when I open a form with one of my custom controls on it that it fails.
I think I at least have the problem figured out, just not sure how to resolve it.
My guess is that since I gave my class a public key and said it can only be used when called with the correct key, the error is because the IDE is the calling assembly when in design mode, and not my actual assembly that this control is referenced in.
At the top of my custom controls class, I have
<StrongNameIdentityPermission(SecurityAction.LinkDemand, PublicKey:="LONG PUBLIC KEY HASH HERE")> _
Basically I guess I need to know how to allow the control at design time, but not allow it at runtime? Or perhaps delayed signing is the solution to this? Any ideas?