Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: GAC Problem


Message #1 by akifnoor@y... on Thu, 18 Apr 2002 07:34:50
Akif,

	When you compile your client application, just reference the
local DLL. So, when you compile your web application/Windows form
application, just use VS.NET "Add Reference" method or csc's
"/reference" parameter to create the reference to your assembly.
However, this is only needed for compilation purposes. After you have
compiled your application, you can delete that DLL, as it's already in
the GAC. So, it's usually good to keep one copy of that DLL in some
folder that you use in all your applications just for compilation
purposes. Also notice how in VS.NET you can specify in the references to
NOT make a local copy the referenced DLL.

Hope this helps,
Minh.

-----Original Message-----
From: akifnoor@y... [mailto:akifnoor@y...] 
Sent: Thursday, April 18, 2002 7:35 AM
To: ASPX_Professional
Subject: [aspx_professional] GAC Problem



I am facing some problem regarding global cache.I have developed a DLL
and 
created its strong name and added in the GAC successfull. But i coul't 
access it in the code with out reference.

Following are the steps i followed to registered a dll in the gac

c# file name MyProject.cs
/////////////////////////////

using System;

[assembly: System.Reflection.AssemblyVersion("1.0.0.0")]
[assembly: System.Reflection.AssemblyKeyFile("Key.snk")]

namespace MyProject{
public class DataClass{


	public string Test(string strTemp){

		return "testing by "+strTemp;

	}

public static void Main(){

}
}//end class
}//end namespace my project

//////////////////////////

Firts i have created a public private pair key as

command line> sn -k mykey.snk

command line> csc /t:library MyProject.cs

command line> gacutil -i MyProject.dll

this command will install the MyProject.dll in hte GAC.

How i can access this shared DLL?

If some body have any idea plz share with me.

Akif Noor


  Return to Index