简体   繁体   中英

Prevent sharing DLL in IIS/ASP.net

lets say I have two ASP MVC applications.

ProjectXXX ProjectYYY - this is fork of ProjectXXX.

Both projects have same structure (project/assembly name), but it differs on some functionality (it will be deployed for other countries).

For testing purposes we deploy both applications on one server.

  • ProjectXXX - has own IIS pool
  • ProjectYYY - has own IIS pool

Problem

When I removed some functionality from assembly of ProjectXXX and run ProjectYYY it throws TypeLoadException : Could not load type 'Project.Namespace.IMyInterface' from assembly 'Project.Namespace'

It looks like ProjectYYY uses DLL from ProjectXXX (IIS (asp.net?) loads dll once, because it "thinks" assemblies are the same?)

How to force IIS not to cache those assemblies and load the proper one for both apps?

EDIT / SOLUTION:

I have found, that my application uses MEF composition. As for now I have changed how it searches for assemblies and problem looks like gone :)

if you create separate IIS Site for each, it should do the trick, as for each site a separate w3wp process is run. Having said that, you can't share same ip and port for 2 sites so if you need that, you'll have to play around with redirecting, url rewriting on IIS.

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