I have one web site in IIS, and I would like to have version 2, 3.5, and 4 applications hosted under the same IIS web site. Is this possible?
Thought it\'d be as ea
You need separate IIS Applications for each web app. Coincidentally, separate apps can have separate App Pools, which in turn can have separate .NET framework versions.
But that's not your issue
In the case of your app, you're having issues with a .NET 2.0 web app and a .NET 3.5 web app, which use the same version of .NET (CLR 2.0). The issue you're seeing is because the sub-app isn't marked as a separate application, so the runtime is looking in the wrong place for the assembly to load your type.
Your site contents probably look something like this:
root (~/)
- bin
* app.dll
- sub-app
- bin
* subapp.dll
When the subapp runs, it's trying to load type Second.Namespa._Default, but the assembly path is to ~/bin (root/bin), which doesn't contain the correct assembly. If you mark sub-app as its own application in IIS, you'll get this:
root (~/)
- bin
* app.dll
- sub-app (~/ again for anything below)
- bin
* subapp.dll
Now loading Second.Namespa._Default will look in the ~/bin (now sub-app/bin), and find the correct assembly and be able to load the type.