Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
Questionwhich class can analyse HTTP? Pin
Xytme6-Jun-04 23:50
Xytme6-Jun-04 23:50 
AnswerRe: which class can analyse HTTP? Pin
Heath Stewart7-Jun-04 5:24
protectorHeath Stewart7-Jun-04 5:24 
QuestionWhere does PrintPreview store the doc ? Pin
sachinkalse6-Jun-04 23:37
sachinkalse6-Jun-04 23:37 
AnswerRe: Where does PrintPreview store the doc ? Pin
Heath Stewart7-Jun-04 5:28
protectorHeath Stewart7-Jun-04 5:28 
Questionhow to share dll? Pin
khchan6-Jun-04 23:37
khchan6-Jun-04 23:37 
AnswerRe: how to share dll? Pin
bneacetp6-Jun-04 23:49
bneacetp6-Jun-04 23:49 
GeneralRe: how to share dll? Pin
khchan7-Jun-04 5:10
khchan7-Jun-04 5:10 
GeneralRe: how to share dll? Pin
Heath Stewart7-Jun-04 5:42
protectorHeath Stewart7-Jun-04 5:42 
Install the assembly into the Global Assembly Cache (GAC). You can do this using gacutil.exe that ships with the .NET Framework (the runtime, not the SDK, so every machine with .NET installed will have it), or a Windows Installer project.

When developing the application, you must still reference the DLL when building (and I recommend a Project reference as opposed to a file reference if these projects are in the same solution - just select the Projects tab when adding a reference). When you run the application, however, if the assembly name is found in the GAC (where the CLR first looks) it will use that copy. Otherwise the CLR reverts to a local copy or a location defined in the app's .config file.

To install into the GAC, your assembly must be strong named, which means it must be signed (always a good idea anyway).

To generate a key pair, use:
sn.exe -k KeyFile.snk
Use the path to that file in the [assembly: AssemblyKeyFileAttribute[ you typically find in your projects' AssemblyInfo.cs files. I recommend using the same one for all your assemblies, or at least for a particular project.

You should also disable automatic versioning of the shared assembly by getting rid of the asterisk (*) in the [assembly: AssemblyVersionAttribute] (also commonly found in the AssemblyInfo.cs file, though they can go anywhere). If you use automatic versioning, you'll need to install a new copy into the GAC with every change. Instead, just managed the version numbers yourself for much better control.

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: how to share dll? Pin
LongRange.Shooter8-Jun-04 4:34
LongRange.Shooter8-Jun-04 4:34 
Generalwhich class can analyse HTTP. Pin
Xytme6-Jun-04 23:09
Xytme6-Jun-04 23:09 
GeneralRe: which class can analyse HTTP. Pin
Heath Stewart7-Jun-04 4:52
protectorHeath Stewart7-Jun-04 4:52 
GeneralRe: which class can analyse HTTP. Pin
Xytme7-Jun-04 15:58
Xytme7-Jun-04 15:58 
GeneralRe: which class can analyse HTTP. Pin
Heath Stewart8-Jun-04 2:43
protectorHeath Stewart8-Jun-04 2:43 
QuestionWich user control is on top? Pin
Klok6-Jun-04 22:59
Klok6-Jun-04 22:59 
AnswerRe: Wich user control is on top? Pin
bneacetp6-Jun-04 23:14
bneacetp6-Jun-04 23:14 
AnswerRe: Wich user control is on top? Pin
Stefan Troschuetz6-Jun-04 23:47
Stefan Troschuetz6-Jun-04 23:47 
GeneralRe: Wich user control is on top? Pin
Klok7-Jun-04 0:01
Klok7-Jun-04 0:01 
GeneralRe: Wich user control is on top? Pin
Klok7-Jun-04 1:39
Klok7-Jun-04 1:39 
GeneralRe: Wich user control is on top? Pin
Stefan Troschuetz7-Jun-04 2:13
Stefan Troschuetz7-Jun-04 2:13 
GeneralDataGrid row colour settings based on contents Pin
ma.poggi-cons6-Jun-04 22:08
ma.poggi-cons6-Jun-04 22:08 
GeneralRe: DataGrid row colour settings based on contents Pin
Jay Shankar6-Jun-04 22:35
Jay Shankar6-Jun-04 22:35 
QuestionHow Can I Access the WAB with C# Pin
Member 9020256-Jun-04 20:24
Member 9020256-Jun-04 20:24 
AnswerRe: How Can I Access the WAB with C# Pin
Heath Stewart7-Jun-04 5:18
protectorHeath Stewart7-Jun-04 5:18 
GeneralCOM+ Word Object Error Pin
Member 3350226-Jun-04 20:15
Member 3350226-Jun-04 20:15 
QuestionHow to build my own database? Pin
fu06-Jun-04 17:04
fu06-Jun-04 17:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.