Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Enterprise Tools / November 2003

Tip: Looking for answers? Try searching our database.

GacUtil.exe Error....

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Soni - 18 Nov 2003 11:22 GMT
Hello,
I am trying to add an assembley to the GAC, but I get the
following error when I use the following in the VS.Net
Command prompt

gacutil.exe -i E:\TestCustom\bin\debug\TestCustomPlc.dll

"Failure adding the assembly to the cache: Attempt to
install an assembly without a strong name"

Any ideas why this is happening?
Jyothi Srinivasan [MS] - 19 Nov 2003 20:58 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.