Add Non-GAC Project Link

Each time I add a link to a web project in visual studio 2008, which is in my GAC, it adds the link as a GAC ​​link and does not copy the file to my bin directory. But for deployment purposes, I would like to add the link as a non-GAC link, so it adds a dll to my bin directory. I tried using the browse button to select a link instead of selecting from a list box, but this also adds a GAC ​​link.

All of these links have a .refresh file with them, and there is no way to copy the local file into the file properties.

Any help please?!?

+2
reference visual-studio-2008
source share
8 answers

Chris, you probably passed this problem a long time ago, but I came across your question trying to do the same in VS 2005. If someone else comes here to look for a solution ...

You are of course right that the web project does not give you the local copy option on your links, which a regular project does, so the Copy Local ... solution is not a starter.

I worked on this problem by simply adding an existing file to the directory of my bin web application. The downside is that it does not add a refresh link, so if you are rebuilding an external file, you will have to manually update the local copy.

+2
source share

Right-click the link, select properties, flip "Copy Local" from "False" to "True"

+4
source share

Set it to copy local

+1
source share

Like someone else, you probably passed this problem a long time ago, but I thought I would throw my solution in the mix.

My problem was a little different. I need a different version of the DLL than the GAC, so my build server could compile the project without installing .dll on it.

To fix this, I manually edited the .csproj file (.vbproj) (using notepad) and updated the link file to point to the local version. If this proves difficult in the future, I will have to delete 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" /> 

:

 <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 the directory at the solution level, one directory from the project file.

+1
source share

1) Remove the GAC link from your project

2) Close Visual Studio

3) gacutil / uf [YourDllName] (gacutil.exe can be found in "C: \ Program Files \ Microsoft Visual Studio 8 \ SDK \ v2.0 \ Bin")

4) Re-open VS and add a link to the "Browse" tab, you will copy the dll to the bin folder and the .refresh file (no more dependent on the GAC) +++

+1
source share

Another way to do this is to simply create the XXX.dll.refresh folders manually and place them in the bin directory.

In fact, I am creating a small helper project to add all the files to my \ Dependencies folder of my solution. Sorry for VB.NET, but this is fast and seems to do the exact same thing as VS.

  For Each fullFileName In Directory.GetFiles("..\..\..\Dependencies\", "*.DLL") Dim shortFileName = Path.GetFileName(fullFileName) Dim refreshFileName = shortFileName + ".refresh" Dim contents = "..\Dependencies\" + shortFileName File.WriteAllText(refreshFileName, contents) Next 
+1
source share

If you reference standard .NET Framework assemblies, then, as I understand it, you cannot have a local copy. The only way is to install the frame on the target computer.

This is a third-party assembly, after which you can copy the assembly to the bin directory manually from the directory in which it is located.

You can also try to remove the assembly from the GAC gacutil.exe in the Windows SDK and see what happens now if you try to add a link to the Overview tab.

0
source share

I spent hours trying to solve this problem and stumbled upon a message opening a visual studio as an administrator. He solved the problem. All reference dlls have been added to bin folders.

0
source share

All Articles