Reference to Projects which have references to the

2019-08-15 19:02发布

问题:

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)