Hello.
I installed VS2010 and NET 4.0 framework and created a simple project. When I uploaded to my server (where I also installed the 4.0 framework), I get this error:
Unrecognized attribute 'targetFramework'
It's coming from this section in the web.config which was auto-generated by VS2010 when I created the project:
I am using Windows Web Server 2008 with IIS 7 (not 6 per your screenshot). Any idea of where to look for same?
Only setting relating to ASP.NET version is on the application pool assignment. I've checked that to ensure the site's pool is set to 4.0. I am currently on "integrated" and watched "classic" fail already.
If you have more than one App Pool, make sure that the one set to 4.0 framework is the one serving the site.. Select the site (or virtual directory) and go to Basic Properties (upper right corner, under "Actions") and make sure that the right app pool
is selected there.. You can also cross-check this in Application Pools tab, by making sure that "Applications" column is not showing 0 for the 4.0 app pool..
Thank you for your valuable feedback. I wish I had better news, but coincidentally, I had checked these exact things prior to my post. Per your response, I just double-checked again -- everything is in order there.
The website is set to the app pool which is the only site using that pool. It is a "4.0 Integrated" pool. I also tried the auto-created pools for 4.0 upon installation of the 4.0 framework. There's one for "integrated" and one for "classic". I tried
them both; neither works.
I tried running the app again (just to see if a good night's sleep for the server might make a difference) and received the same error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 10: during development.
Line 11: -->
Line 12: <compilation debug="true" targetFramework="4.0">
Line 13: <assemblies>
Line 14:
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.20506; ASP.NET Version:4.0.20506.1
The odd thing is that this same app runs fine on my local machine (which has 32-bit Vista Home Premium). It's just the server which gives this error (running Windows Web Server 2008).
Anyone have further thoughts before I go back to 3.5 Framework?
Had never noticed that the 4.0.x.x versions were different on my local vs. the server. I actually downloaded both at the same time, but must have gotten the wrong download on the server since I didn't want VS2010 with it there.
Thanks so much for your help. Hurdle #1 down; 176 more to go :-)
Had the same problem, I actually did have the correct version of .net installed, but didn't have my application pool set to use it in IIS, just in case this helps anyone else.
aspnetNovice...
Member
4 Points
37 Posts
Unrecognized attribute 'targetFramework'
Nov 10, 2009 07:46 PM|LINK
Hello.
I installed VS2010 and NET 4.0 framework and created a simple project. When I uploaded to my server (where I also installed the 4.0 framework), I get this error:
Unrecognized attribute 'targetFramework'
<div style="BACKGROUND-COLOR: white; COLOR: black" mce_style="BACKGROUND-COLOR: white; COLOR: black"> </div>It's coming from this section in the web.config which was auto-generated by VS2010 when I created the project:
I've checked and ensure that the application pool for my website on the server is set to "4.0 Integrated".
Any feedback on how to get past this error would be appreciated. It's all I can do to keep from running back to VS2008 and NET 3.5.
Thank you!
jclark434175
Member
301 Points
46 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 10, 2009 08:42 PM|LINK
Try to check the properties on the website for ASP.NET 4.0 like so:
In IIS > Right click on WebSite > Properties > ASP.NET > Version > "Should read 4.0.21006" not 2.0
Check this link for the image > http://7377925954623298310-a-1802744773732722657-s-sites.googlegroups.com/site/joshuaclarkhosting/syntaxheighlighter/aspNET40.PNG?attachauth=ANoY7cprOXRfZxqEW57vbtFzxz7MaPpHM_m-SKB6QDGYgLFhV4yUNs3NlHOWIhSVIzTCvj50AHTquEIiLN55b7OP4dAYP9CqEsz54_DVJg_RaUaDywaNfpCtA3pFGVjWVE0eQ0PAfO1IsDfkGEi8Go--AWRrMvwVVpUASrPWbvaiI9iVuORE9oONIiJ2UUqNQ54oBT4uy_U3UiGcAIUs07HSa_iNXwiAl61CBJyysoNyxsS-7kQVlkU%3D&attredirects=0
Hope this helps
4.0 VS2010
jclark434175@gmail.com
Please mark this question as answered if it helped you. Thanks!
aspnetNovice...
Member
4 Points
37 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 10, 2009 09:29 PM|LINK
I am using Windows Web Server 2008 with IIS 7 (not 6 per your screenshot). Any idea of where to look for same?
Only setting relating to ASP.NET version is on the application pool assignment. I've checked that to ensure the site's pool is set to 4.0. I am currently on "integrated" and watched "classic" fail already.
Radomir
Member
194 Points
46 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 11, 2009 01:59 PM|LINK
If you have more than one App Pool, make sure that the one set to 4.0 framework is the one serving the site.. Select the site (or virtual directory) and go to Basic Properties (upper right corner, under "Actions") and make sure that the right app pool is selected there.. You can also cross-check this in Application Pools tab, by making sure that "Applications" column is not showing 0 for the 4.0 app pool..
aspnetNovice...
Member
4 Points
37 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 11, 2009 06:13 PM|LINK
Radomir,
Thank you for your valuable feedback. I wish I had better news, but coincidentally, I had checked these exact things prior to my post. Per your response, I just double-checked again -- everything is in order there.
The website is set to the app pool which is the only site using that pool. It is a "4.0 Integrated" pool. I also tried the auto-created pools for 4.0 upon installation of the 4.0 framework. There's one for "integrated" and one for "classic". I tried them both; neither works.
I tried running the app again (just to see if a good night's sleep for the server might make a difference) and received the same error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.
Source Error:
Line 10: during development.
Line 11: -->
Line 12: <compilation debug="true" targetFramework="4.0">
Line 13: <assemblies>
Line 14:
Source File: C:\inetpub\SiteData\mywebsite\web.config Line: 12
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.20506; ASP.NET Version:4.0.20506.1
The odd thing is that this same app runs fine on my local machine (which has 32-bit Vista Home Premium). It's just the server which gives this error (running Windows Web Server 2008).
Anyone have further thoughts before I go back to 3.5 Framework?
Radomir
Member
194 Points
46 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 11, 2009 08:07 PM|LINK
Just a quick thought -- I'd get that server up to Beta 2.. looks like you're on some older build.. version should be 4.0.21006.1
aspnetNovice...
Member
4 Points
37 Posts
Re: Unrecognized attribute 'targetFramework'
Nov 11, 2009 09:00 PM|LINK
Yes! Nice job! That did the trick.
Had never noticed that the 4.0.x.x versions were different on my local vs. the server. I actually downloaded both at the same time, but must have gotten the wrong download on the server since I didn't want VS2010 with it there.
Thanks so much for your help. Hurdle #1 down; 176 more to go :-)
jwkeenan
Member
261 Points
169 Posts
Re: Unrecognized attribute 'targetFramework'
Jan 06, 2010 12:57 AM|LINK
Had the same problem, I actually did have the correct version of .net installed, but didn't have my application pool set to use it in IIS, just in case this helps anyone else.
KannanThirum...
Member
2 Points
1 Post
Re: Unrecognized attribute 'targetFramework'
Feb 25, 2010 07:36 AM|LINK
I too solved this by setting the Application Pool to ASP.NET v4.0 in the IIS.
Thank you !
jsl
Member
2 Points
1 Post
Re: Unrecognized attribute 'targetFramework'
Mar 04, 2010 10:47 PM|LINK
Likewise -- updating the framework does not update the applicaiton pool. Thanks for the tip.