.net Visual Studio 2010中引用程序集的替代引用?
我正在尝试使用另一个核心框架库,同时仍然以.NETFramework4.0为目标。当我向备用文件添加手动引用时,Visual Studio会在.net Visual Studio 2010中引用程序集的替代引用?,.net,visual-studio,visual-studio-2010,.net,Visual Studio,Visual Studio 2010,我正在尝试使用另一个核心框架库,同时仍然以.NETFramework4.0为目标。当我向备用文件添加手动引用时,Visual Studio会在C:\Program Files(x86)\reference Assembly\Microsoft\Framework\.NETFramework\v4.0\中创建对同一命名文件的引用 我可以禁用此行为吗?尝试以下操作: 1 - Remove the reference. 2 - Clear your project bin/debug folder.
C:\Program Files(x86)\reference Assembly\Microsoft\Framework\.NETFramework\v4.0\
中创建对同一命名文件的引用
我可以禁用此行为吗?尝试以下操作:
1 - Remove the reference.
2 - Clear your project bin/debug folder. If possible delete these
folders!
3 - Add the reference again.
您可能需要在上述步骤之间重新启动Visual Studio。如果dll已在GAC中,则删除现有dll将不起作用。
尝试将引用标记为
特定版本=true
(右键单击->属性)
编辑:添加引用后(即使实际添加了错误的引用),请编辑csproj文件,找到引用,并使用特定的dll属性对其进行编辑:
<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>
真的
..\..\ExternalLibrary\Microsoft.Practices.EnterpriseLibrary.Logging.dll
尝试在Visual Studio中运行Clean solution命令。。。您确定可以将此替代DLL与.NET 4.0一起使用吗?它支持.NET4吗?再看看这个:也试过清洁。该DLL绝对支持.NET 4.0。不幸的是,我无法从GAC中删除核心DLL,因此该解决方案无法工作。我无法在不添加引用的情况下标记Specific Version=true
。这样做,再加上找到替换程序集的新强名称,效果非常好。谢谢另外,您还需要执行True
,这样它就可以复制本地
;否则,在部署时将出现问题。