Registering .Net 2.0 assembly in GAC

G

Guest

I have created a simple .net class library

AdapterLibrary.dll, which contains a single class definition
AdapterLibrary.Service (code at end of posting). I have signed the assembly
and I attempt to install in the GAC.

Using Visual Studio 2005 (.net 2.0) to build the dll results in me not being
able to install the assembly in the GAC.

*********************************************
gacutil /i AdapterLibrary.dll

Microsoft (R) .NET Global Assembly Cache Utility. Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Failure adding assembly to the cache: Unknown Error

*********************************************

However, if I take the code from this project and compile using VS 2003 I
have absolutely no problems installing the assembly in the GAC.

Can anyone advise on this please?


*********************************************
* Service.cs
*********************************************
using System;
using System.Xml;

namespace AdapterLibrary
{
public class Service
{
public Service() { }

public void Initialise(XmlDocument config) { }

public XmlDocument Execute()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml("<hello><world2/></hello>");
return (doc);
}
}
}
*********************************************
 
D

Dave Sexton

Hi Billr,

My version of 2.0 gacutil is 2.0.50727.42. Make sure that the gacutil.exe
that you are executing lives in the 2.0.* folder.

HTH
 
G

Guest

Dave,

of course, now that you have pointed it out, I can see that I am using
gacutil that ships with vs2003.

Having multiple versions of VStudio on my machine really doesn't help
matters much!

So, of course, once I have made sure that I have run the relevent
vsvars32.bat everything works as intended.

Thanks for pointing that out to me :blush:)
 
B

Barry Kelly

billr said:
Using Visual Studio 2005 (.net 2.0) to build the dll results in me not being
able to install the assembly in the GAC.
gacutil /i AdapterLibrary.dll

Microsoft (R) .NET Global Assembly Cache Utility. Version 1.1.4322.573
^^^^^^^^^^^^
Perhaps the version number on gacutil may give you a clue. You have the
wrong gacutil on your path.

-- Barry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top