参考替换引用集在Visual Studio 2010中? [英] Reference alternate to reference assembly in Visual Studio 2010?

查看:180
本文介绍了参考替换引用集在Visual Studio 2010中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图用另一种核框架库,同时还针对.NET Framework 4.0中。当我添加手动参考备用文件时,Visual Studio,而不是创建引用同一命名文件 C:\ Program Files文件(x86)的\参考大会\微软\框架\ .NETFramework \ V4。 0 \

I'm trying to use an alternative core framework library while still targeting .NET Framework 4.0. When I add a manual reference to the alternate file, Visual Studio instead creates a reference to the same named file in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\.

我可以禁用此行为?

推荐答案

如果该dll已经在海关总署,消除现有的DLL将无法工作。
尝试标记引用作为特定版本= TRUE (右键 - >属性)。

If the dll is already in the GAC, removing existing dlls will not work.
Try to mark the reference as Specific Version = true (Right click -> Properties).

编辑:
在添加引用(即使实际添加了错误的),编辑您的csproj文件,找到参照,并与您的特定DLL的属性编辑:


After you have added the reference (even if the wrong one was actually added), edit your csproj file, find the reference, and edit it with your specific dll properties:

<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
  <SpecificVersion>True</SpecificVersion>  
  <HintPath>..\..\ExternalLibrary\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
</Reference>

这篇关于参考替换引用集在Visual Studio 2010中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆