Hi all, I've run into a puzzle on a Windows Server 2008 server (SP1) where we recently deployed an ASP.NET web application compiled to target .NET Framework 4.0. The web app is deployed to a web site on the server to run in a .NET 4.0 Application pool. IIS
Manager version is 7.0
I see in IIS Manager, under the ".NET Compilation" Feature that the assemblies which are listed are for framework version 2.0. I guess this means that 2.0 version of the framework assemblies will be used to do the ASP.NET dynamic compilation
for our web app. Which is not what we want since our web app should target framework v 4.0
When I check the .NET Compilation Feature on the web server root in IIS Manager (the server name node in IIS Manager left nav), I see framework version 2.0 assemblies. Which means these settings are being inherited from somewhere higher in the ASP.NET inheritance
hierarchy.
I checked both machine. config and the root web.config on the server – the 4.0 version of the root web.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\) has framework version 4.0 assemblies specified in it and the 2.0 version of root web.config
(C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\) has framework version 2.0 assemblies specified in it .
So, why does our web app running in a version 4.0 App pool show version 2.0 assemblies in IIS Manager? Where are thse settings being inherited from?
Please let me know if I need to look at additional info on the server to answer this question.
It really shouldn't matter if when going to .NET Compilation on the server itself in IIS is set to v2.0 assemblies. Thats default and the way it is on our IIS machines as well and this is not inherited into web sites created on the server. Going into a v4.0
website on our servers I only see only v4.0 assemblies for the site itself.
Are you seeing only v2.0 or both v2.0 and v4.0 assemblies under .NET Compilation for the specific site?
Did you double check to make sure Visual Studio is set to target the .NET Framework 4.0?
Are any third party controls you may be using compiled under .NET 2 or 3 Frameworks?
Does your Web.config maybe have old referances to v2 or v3 assemblies?
The v2.0 assemblies are showing up under .NET Compilation in IIS Manager for
any web site on the server whether the associated App pool is v2.0 or v4.0. Which does not make sense to me! That's why I posted to the forums.
On my development computer, things appear the way I expect them to be- web sites running in v2.0 App Pools show v2.0 assemblies and sites in v4.0 App Pools show v4.0 assemblies.
Are you seeing only v2.0 or both v2.0 and v4.0 assemblies under .NET Compilation for the specific site?
For the specific site in question, I see only v2.0 assemblies
Did you double check to make sure Visual Studio is set to target the .NET Framework 4.0?
Yes, it's set to v4.0
Are any third party controls you may be using compiled under .NET 2 or 3 Frameworks?
No
Does your Web.config maybe have old referances to v2 or v3 assemblies?
No
Are you seeing only v2.0 or both v2.0 and v4.0 assemblies under .NET Compilation for the specific site?
For the specific site in question, I see only v2.0 assemblies
I don't understand how this is the case if your application is in fact referancing v4 referances...
Sorry I am at a loss maybe the fine folks over in the IIS forums can help you out.
http://forums.iis.net/
When you say " if your application is in fact referancing v4 referances"- I want to make it clear- yes, our web application has assembly references to v4.0 framework assemblies only (if you check in Visual Studio, under References).
However, in the web.config of our app, under <compilation>\<assemblies> element, we do not have any explicit references to framework v4.0 assemblies. I have never had to specify a list of all framework v4.0 assemblies like this in web.config.
I have never had to specify a list of all framework v4.0 assemblies like this in web.config.
And you shouldn't have to.
The only way I was able to recreate your problem was when I set my application pool assigned to the site to v2.
Check that the correct application pool is in fact being used by the site by selecting the site in question then opening "Basic Settings..." in the right hand column. If not use "Select" to select the correct one.
Maybe try recreating your application pool if it is in fact set to v4 maybe its "gummed up" somewhere.
Seriously, believe me I've checked everything you're suggesting many times over.
I have a theory- you know how config files allow you to lock down a given setting at a given level e.g. you can lock down the <compilation> debug flag at a web site level so that child applications cannot override or change that flag. I am wondering if somewhere
in machine.config or the root Web.config, there's a setting which effectively locks down the assembly versions so that no matter what App pool you use, you always end up with v2.0 assemblies. I'll look again at the server this afternoon and report back what
I find.
Just to update this thread- I did not find any lockItem attributes in the root Web.config. I was expecting to see something like this in the root Web.config on the server:
Manish_Y
0 Points
7 Posts
web.config compilation assemblies inheritance issue in IIS
Dec 06, 2012 06:08 PM|LINK
Hi all, I've run into a puzzle on a Windows Server 2008 server (SP1) where we recently deployed an ASP.NET web application compiled to target .NET Framework 4.0. The web app is deployed to a web site on the server to run in a .NET 4.0 Application pool. IIS Manager version is 7.0
I see in IIS Manager, under the ".NET Compilation" Feature that the assemblies which are listed are for framework version 2.0. I guess this means that 2.0 version of the framework assemblies will be used to do the ASP.NET dynamic compilation for our web app. Which is not what we want since our web app should target framework v 4.0
When I check the .NET Compilation Feature on the web server root in IIS Manager (the server name node in IIS Manager left nav), I see framework version 2.0 assemblies. Which means these settings are being inherited from somewhere higher in the ASP.NET inheritance hierarchy.
I checked both machine. config and the root web.config on the server – the 4.0 version of the root web.config (C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\) has framework version 4.0 assemblies specified in it and the 2.0 version of root web.config (C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\) has framework version 2.0 assemblies specified in it .
So, why does our web app running in a version 4.0 App pool show version 2.0 assemblies in IIS Manager? Where are thse settings being inherited from?
Please let me know if I need to look at additional info on the server to answer this question.
jprochazka
Contributor
4992 Points
748 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 06, 2012 06:15 PM|LINK
Is this application running within another application?
Meaning is this application contained within a subfolder of another application within the web site.
If so the child application maybe inheriting from the parent. You can try implementing inheritInChildApplications.
http://msdn.microsoft.com/en-us/library/system.configuration.sectioninformation.inheritinchildapplications.aspx
<location path="." inheritInChildApplications="false"> <system.web> ... </system.web> <system.webServer> ... </system.webServer> ... </location>This should stop parent settings from being inherited in the child application if this is the case.
Manish_Y
0 Points
7 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 06, 2012 06:37 PM|LINK
Thanks jprochazka. Our web app is not a child of another web site or web app. So, it is not inheriting any settings from a parent web site/app.
As I mentioned, at the root web server level in IIS Manager, the assemblies showing up in IIS Manager are already v 2.0
So, any web site on this server ends up inheriting references to v 2.0 assemblies.
jprochazka
Contributor
4992 Points
748 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 06, 2012 07:19 PM|LINK
It really shouldn't matter if when going to .NET Compilation on the server itself in IIS is set to v2.0 assemblies. Thats default and the way it is on our IIS machines as well and this is not inherited into web sites created on the server. Going into a v4.0 website on our servers I only see only v4.0 assemblies for the site itself.
Are you seeing only v2.0 or both v2.0 and v4.0 assemblies under .NET Compilation for the specific site?
Did you double check to make sure Visual Studio is set to target the .NET Framework 4.0?
Are any third party controls you may be using compiled under .NET 2 or 3 Frameworks?
Does your Web.config maybe have old referances to v2 or v3 assemblies?
Manish_Y
0 Points
7 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 06, 2012 08:42 PM|LINK
The v2.0 assemblies are showing up under .NET Compilation in IIS Manager for any web site on the server whether the associated App pool is v2.0 or v4.0. Which does not make sense to me! That's why I posted to the forums.
On my development computer, things appear the way I expect them to be- web sites running in v2.0 App Pools show v2.0 assemblies and sites in v4.0 App Pools show v4.0 assemblies.
Are you seeing only v2.0 or both v2.0 and v4.0 assemblies under .NET Compilation for the specific site? For the specific site in question, I see only v2.0 assemblies
Did you double check to make sure Visual Studio is set to target the .NET Framework 4.0? Yes, it's set to v4.0
Are any third party controls you may be using compiled under .NET 2 or 3 Frameworks? No
Does your Web.config maybe have old referances to v2 or v3 assemblies? No
jprochazka
Contributor
4992 Points
748 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 07, 2012 11:46 AM|LINK
I don't understand how this is the case if your application is in fact referancing v4 referances...
Sorry I am at a loss maybe the fine folks over in the IIS forums can help you out. http://forums.iis.net/
Good luck.
Manish_Y
0 Points
7 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 07, 2012 01:29 PM|LINK
When you say " if your application is in fact referancing v4 referances"- I want to make it clear- yes, our web application has assembly references to v4.0 framework assemblies only (if you check in Visual Studio, under References).
However, in the web.config of our app, under <compilation>\<assemblies> element, we do not have any explicit references to framework v4.0 assemblies. I have never had to specify a list of all framework v4.0 assemblies like this in web.config.
jprochazka
Contributor
4992 Points
748 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 07, 2012 01:52 PM|LINK
And you shouldn't have to.
The only way I was able to recreate your problem was when I set my application pool assigned to the site to v2.
Check that the correct application pool is in fact being used by the site by selecting the site in question then opening "Basic Settings..." in the right hand column. If not use "Select" to select the correct one.
Maybe try recreating your application pool if it is in fact set to v4 maybe its "gummed up" somewhere.
Manish_Y
0 Points
7 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 07, 2012 02:12 PM|LINK
Thanks jprochazka for the continued support.
Seriously, believe me I've checked everything you're suggesting many times over.
I have a theory- you know how config files allow you to lock down a given setting at a given level e.g. you can lock down the <compilation> debug flag at a web site level so that child applications cannot override or change that flag. I am wondering if somewhere in machine.config or the root Web.config, there's a setting which effectively locks down the assembly versions so that no matter what App pool you use, you always end up with v2.0 assemblies. I'll look again at the server this afternoon and report back what I find.
Manish_Y
0 Points
7 Posts
Re: web.config compilation assemblies inheritance issue in IIS
Dec 10, 2012 05:40 PM|LINK
Just to update this thread- I did not find any lockItem attributes in the root Web.config. I was expecting to see something like this in the root Web.config on the server:
But no luck. Mystery remains unsolved.