简体   繁体   English

对具有不同版本的相同dll的引用的项目的引用

[英]Reference to Projects which have references to the same dll with different versions

in my c# class lib i have referenced different Projects which have references to the same dll with different versions. 在我的C#类库中,我引用了不同的项目,这些项目引用了具有不同版本的同一dll。

Both references the nlog.dll but one project version 2.1 and the other 4.2. 两者都引用nlog.dll,但是一个项目版本为2.1,另一个项目版本为4.2。

The referenced project are class libs, too. 引用的项目也是类库。 Most of them are .net 2.0 and some 4.5. 其中大多数是.net 2.0和4.5。

Just make a Libraries folder if you need to and then create a version folder structure and 'add reference' to each project. 如果需要,只需创建一个Libraries文件夹,然后创建一个版本文件夹结构并为每个项目“添加引用”。 If these are nuget packages then you shouldnt need to do this. 如果这些是nuget软件包,那么您就不需要这样做。

You need to install in the the GAC because you application has only one bin folder. 您需要在GAC中安装,因为您的应用程序只有一个bin文件夹。

You can also try installing only NLog 4 with a <assemblyBinding> but no guarantees as NLog 2 and NLog 4 aren't fully compatible. 您也可以尝试仅安装带有<assemblyBinding> NLog 4,但不能保证,因为NLog 2和NLog 4不完全兼容。 (hence the major version change) (因此更改了主要版本)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 MVC插件网站,其中引用了相同dll的不同版本 - MVC plugin site with references to different versions of same dll 如何在应用程序中使用两个dll引用相同dll的不同版本? - How to use two dlls in an application which reference different versions of same dll? 需要一种方法来引用同一个第 3 方 DLL 的 2 个不同版本 - Need a way to reference 2 different versions of the same 3rd party DLL 使用相同dll的2个不同版本? - Using 2 different versions of the same dll? 如何动态加载引用同一程序集不同版本的DLL? - How to dynamically load DLLs which reference different versions of same assembly? 使用在 Nancy Projects 上引用第 3 方 32 位 C dll 的引用会导致 System.BadImageFormatException - Using a reference which references a 3rd-party 32-bit C dll on a Nancy Projects causes System.BadImageFormatException 在项目中使用相同DLL的不同版本 - Using different versions of the same DLL in a project 相同dll和EF的不同版本。 - Different versions of same dll and EF. 为什么同一个DLL会有不同的版本信息? - Why are there Different versions info for the same DLL? MSBuild用两个不同的项目构建相同的DLL - MSBuild Build same DLL with two different projects
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM