Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

how can create GAC .dll in C#?.I want to access that .dll without adding reference in my project.like using System namespace.

Thanks.
Posted

No.. A dll cannot be accessed unless you add its reference. You can create a dll and install in GAC , but still you will have to add the reference.

And the other thing to correct is that the reference to System.dll is added to the Visual Studio project by default... Try creating a VS project and check the dll references added by default
 
Share this answer
 
You can't - you have to add a reference to an DLL you application references, including System ones. When you create a project in VS, these are added for you - look under References in your Project in the Solution Explorer pane.

You can add a reference to this list when you create a new project: http://stackoverflow.com/questions/9272239/how-to-add-custom-libraries-to-default-solution-template[^] and add the appropriate using statements by defualt by editing the existing project templates: Adding your items to Visual Studio default files[^]
 
Share this answer
 
Hi,

Use Gacutil.exe[^]
gacutil /i dllpath.dll

At the Wikipedia page, you'll find the requirements for assemblies residing in the GAC:

Requirements



Assemblies residing in the GAC must adhere to a specific versioning scheme which allows for side-by-side execution of different code versions. Specifically, such assemblies must be strongly named.

But, as the others pointed out, you still have to add a reference to your assembly.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900