Hello Soni,
You are seeing this error since the assembly is not signed with a strong
name. There are two ways around this.
1) Sign the assembly with a strong name. This can be done using Strong Name
tool (sn.exe)
sn -k MyKey.snk
If you are using an IDE, such as Visual Studio .NET, to sign an assembly
with a strong name, you must understand where the IDE looks for the key
file. For example, Visual Basic .NET looks for the key file in the
directory containing the Visual Studio Solution, whereas the C# compiler
looks for the key file in the directory containing the binary. Put the key
file in the appropriate project directory and set the file attribute as
follows:
[Visual Basic]
<Assembly: AssemblyKeyFileAttribute("key.snk")>
[C#]
[assembly: AssemblyKeyFileAttribute(@"..\..\key.snk")]
More info can be obtained from
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcreatingkeypairforuseincreatingstrongly-namedassembly.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconstrong-namedassemblies.asp
2) Delay signing the assembly which means actual signing can defer until
the final stage and skip the verification process.
sn -Vr E:\TestCustom\bin\debug\TestCustomPlc.dll
CAUTION Use the -Vr option only during development. Adding an assembly to
the skip verification list creates a security vulnerability. A malicious
assembly could use the fully specified assembly name (assembly name,
version, culture, and public key token) of the assembly added to the skip
verification list to fake its identity. This would allow the malicious
assembly to also skip verification.
More info can be seen in
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconDelayedSigningAssembly.asp
Hope this helps,
Regards,
Jyothi
| Hello,
| I am trying to add an assembley to the GAC, but I get the
[quoted text clipped - 7 lines]
|
| Any ideas why this is happening?