[英]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.