views:

28

answers:

1

HY,

Know someone how can i add a assembly to GAC and Add reference dialog automatically in same time. I have a setup project which i set him to add the assembly automatically to GAC, but i can`t add that in add reference dialog from visual studio 2010. I search on the internet but i didn't found how to do it.

The idea is that i have a project template from a project which use two assembly. I want to placed the 2 assembly in GAC when he is running the setup of the framework which i give to him.

Thanks.

+2  A: 

Your English is hard to decode but it sure sounds like you are on the wrong track with this. The GAC is a deployment detail. You'll have no trouble putting an assembly in the GAC with your Setup project.

That assembly does not belong in the GAC on your dev machine. To add the reference, simply use the Add Reference dialog and use either the Project or Browse tab.

If your assembly is intended to be used by another programmer so that she can use your product in her own project then you need to deploy your assembly twice. It needs to go into the GAC and a copy of the assembly needs to go in a dedicated folder so your client can add the reference to it in her own project. The c:\program files\reference asssemblies directory is a good place to put it.

Putting it in the GAC for her is optional btw, it isn't that commonly done. I think most programmers would prefer that you don't do this, unless you work for a Big Company that needs to automatically distribute security updates. Putting it in the GAC just makes it harder for your client to write her own Setup project since she has to run yours first.

Hans Passant
Thank you, i got the idea :)
tribanp
Okey dokey, please close your thread by marking it answered.
Hans Passant