简体   繁体   中英

IIS local, 2 websites, 2 application pool and “shared” dll problems

We developped 2 differents applications with visual studio 2013 : The first for the front-end in C# .net mvc5 The second for a web service in C# .net WebApi 2

Both applications use newtonsoft.json nuget but with different versions (6.0.8 for front and 8.0.2 for web api).

We use Local IIS to test and debug. In IIS we create 2 websites, and 2 separate application pool.

If i compile the the web service after front end, everything is fine. If i compile the front end after the web service, the web service crash with the 6.0.8 version of newtonsoft.json ! Why ?

The application pools shared some dlls ?

I found some articles with the "Specific version" option of the reference in the projects. With the "specific version" at true, both version can run in parallel. But i don't want to do that.

I can also update the nuget to have the same version in both projects but it is a workaround, the problem could still there with another dlls.

I need to understand why with 2 applications pool share dlls (with différents versions)... So do you have an idea :-) ?

Thanks Whiletrue

Following from your comment - the reason is quite simple now. your webapi and mvc project both depend on classlib which depends on newtonsoft specific version. so when you build any of webapi or mvc project, classlib's dependencies are also added to webapi or mvc project. you can either break the dependency somehow or specify versions in the web config + project file explicitly and have both versions in your Bin folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM