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

岁酱吖の 提交于 2019-12-13 19:30:11

问题


in my c# class lib i have referenced different Projects which have references to the same dll with different versions.

Both references the nlog.dll but one project version 2.1 and the other 4.2.

The referenced project are class libs, too. Most of them are .net 2.0 and some 4.5.


回答1:


Just make a Libraries folder if you need to and then create a version folder structure and 'add reference' to each project. If these are nuget packages then you shouldnt need to do this.




回答2:


You need to install in the the GAC because you application has only one bin folder.

You can also try installing only NLog 4 with a <assemblyBinding> but no guarantees as NLog 2 and NLog 4 aren't fully compatible. (hence the major version change)



来源:https://stackoverflow.com/questions/35505464/reference-to-projects-which-have-references-to-the-same-dll-with-different-versi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!