views:

892

answers:

6

Every time I add a reference to a web project in visual studio 2008 that is in my GAC, it adds the reference as a GAC reference and doesn't copy the file to my bin directory. But for deployment purposes, I would like to add the reference as a non-GAC reference so it adds the dll to my bin directory. I've tried using the browse button to select the reference instead of picking from the list window, but that adds a GAC reference too.

These references all have the .refresh file with them and there is not an option to copy local in the properties of the file.

Any help please?!?

+4  A: 

Right click on the reference, select properties, flip Copy Local from False to True

Matt Briggs
There is not an option to copy local. The only options available in the properties are: Auto-refresh path, File Name and Full Path.
Chris Conway
You are not looking at the right thing then.
StingyJack
The values you gave are not in the references properties dialog
Matt Briggs
+1  A: 

Set it to Copy Local

hmcclungiii
A: 

If you reference .NET Framework standard assemblies, then as I understand you couldn't have a local copy of it. The only way is to install framework on target computer.

It it is a third party assembly then you could copy assembly to bin directory manually from directory where it is located.

You may also try to remove assembly from GAC by gacutil.exe in Windows SDK and look what will happen now if you try to add reference by 'Browse' tab.

Kaagle
+1  A: 

Chris, you're probably long past this problem, but I stumbled upon your question when trying to do the same thing in VS 2005. In case anyone else comes here looking for a solution....

You are correct, of course, that a web project does not give you the copy local option on your references that a normal project does, so the Copy Local... solution is a non-starter.

I worked around this problem by simply adding an existing file to my web app's bin directory. The drawback is that it doesn't add the refresh reference, so if you rebuild the external file you'll have to manually refresh the local copy.

cori
+1  A: 

Like someone else mentioned, you're probably long past this problem but I thought I'd throw my solution in the mix.

My problem was a little bit different. I wanted a non-GAC version of a .dll so my build server could compile the project without having the .dll in question installed on that server.

To fix this, I edited the .csproj (.vbproj) file manually (using notepad) and updated the reference file to point to the local version. If this proves troublesome in the future, I'll have to uninstall the project and just use the .dll.

In my case, I changed the line:

<Reference Include="Microsoft.Data.Entity.CTP, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL" />

to be:

<Reference Include="Microsoft.Data.Entity.CTP, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\Lib\Microsoft.Data.Entity.CTP.dll</HintPath>
</Reference>

where ..\Lib is a directory at the solution level, one directory up from the project file.

luckyllama
A: 

1) Remove the GAC reference from your project 2) Close Visual Studio 3) gacutil /uf [YourDllName] (gacutil.exe should be found in "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin") 4) Re-open VS and add reference within the "Browse" tab you will have the dll copied into your bin folder and a .refresh file (no more GAC dependency) +++

Rodo