You do not need to install it into the GAC if you are just wanting to enable developers to reference the assembly from the .NET tab of the Add Reference dialog box. Simply copy the assembly to the

%Program Files%\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies folder.

If you do want install it to the GAC, in VS 2008, you first need to create a strong-named assembly because the GAC requires it.

1. Generate a key file. You can do this from the Visual Studio Command Prompt by typing "sn -k mykeyfile.snk"

2. In the Project Properties for your assembly, on the Build tab, under Other flags, add "--keyfile:mykeyfile.snk"

Build, this gets you a strong-named assembly.

Now you can just use gacutil.exe to add this assembly to the GAC. You do not need an MSI. The command line is "gacutil /i myassembly.dll".

If you want the MSI to do this then create a Setup project.

1. Add New Project. Select "Other Project Types" and choose "Setup and Deployment" then "Setup Project"

2. In the File System tab, under "File System on Target Machine" right click and select "Add Special Folder" and then "Global Assembly Cache Folder"

3. Right click "Global Assembly Cache Folder" and select "Project Output..." then choose the project that is generating the assembly you want to deploy to the GAC. Choose "Primary Output" which is the assembly.

Build the setup project. It may not be selected to build by default. This will generate an MSI if all goes well. The MSI will install your assembly to the GAC.

By on 2/2/2010 3:33 PM ()

One more thing: to get the above steps to work, I had to actually put the full path to the key file in the command line option:

--keyfile:"C:\....\mykeyfile.snk"

By on 2/2/2010 3:42 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper