Thank you for reaching out!
If you want two web apps to use two different DLLs with the same name, deploy them as two separates ASP.NET applications, each with its own /bin folder. ASP.NET loads DLLs per application: each app gets its own assembly cache and does not mix DLLs even if the names are identical.
In other words, Put some.dll (old version) in App1/bin, and some.dll (new version) in App2/bin. The apps will remain isolated and use their respective DLL versions.
Put Each App in its Own Application Directory:
If you have:
/App
/bin
some.dll (old version)
/App2
/bin
some.dll (new version)
ASP.NET will not mix these DLLs.
Each App loads only the DLLs inside its own /bin directory.
This requires:
- App1 and App2 must be separate virtual apps in IIS (Not subfolders of the same app unless marked as apps)
- Each app must have its own web.config and bin folder
What will not work:
- Putting both DLLs in the same /bin folder
- Using <Probing> to force different versions
- Using shadow copying tricks
ASP.NET will always load from its own /bin before probing any additional paths, So you cannot override that inside one application.
Reference: https://learn.microsoft.com/en-us/previous-versions/aspnet/ff651860(v=orm.10)
Let me know if you need any further help with this. I will be happy to assist. If you find this helpful, Kindly mark the provided solution as "Accept Answer", so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.