如何强制Visual Studio中引用而不是安装目录文件的本地企业库DLL文件文件、企业库、安装目录、而不是

2023-09-03 08:09:42 作者:曼妙身姿衬娇颜/魂牵梦萦绕我心

我有一个asp.net项目引用企业库DLL的。我可以构建和部署我的项目,但部署构建失败,因为它找不到DLL的。我偷看了属性Microsoft.P​​ractices.EnterpriseLibrary.Common,例如,我注意到文件路径它被安装在\ Program Files文件\内容十分重要。我已经尝试添加引用到我的项目,特别选择从被部署的与我的项目我的/ lib文件夹中的DLL。 VS似乎只是说是的,当然。文件路径仍然是下一个程序文件... - 什么我假设是一个GAC参考。我试图寻找在GAC卸载,但我没有看到它在那里。谁能帮我解释一下VS,我真的希望这个本地文件?

I've got a asp.net project that references Enterprise Library DLL's. I can build and deploy my project but the deployment build fails because it can't find the DLL's. I peeked at the properties for Microsoft.Practices.EnterpriseLibrary.Common, for example, and I notice that the file path is where it was installed in \Program Files\yada yada... I've attempted Add Reference to my project and specifically choose the dll from my /lib folder which gets deployed with my project. VS just seems to say "yeah, sure". The file path remains to be the one under "Program Files..."--what I am assuming is a GAC reference. I tried looking at the GAC to uninstall, but I don't see it there. Can someone help me explain to VS that I really do want this local file?

推荐答案

好吧,我不得不深入到.proj文件。在有标签。您可以添加参考标签内指导项目到一个特定的DLL实例。

Okay, I had to dig into the .proj files. Under are tags. You can add within the Reference tags to direct the project to a specific DLL instance.

<ItemGroup>
  <Reference Include="Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" >
    <HintPath>..\lib\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
  </Reference>
  ...