Unrecognized attribute 'targetFramework'. Note > that attribute names are case-sensitive - asp.net

I try to publish a web application from my VS2012 to a remote computer.
I published the files but when I try to open the website, I get this error:
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 41:
Line 42: <compilation targetFramework="4.0" />
Line 43: <httpRuntime targetFramework="4.0" />
Line 44: <authentication mode="Forms">
Line 45: <forms loginUrl="~/" timeout="2880" />
(line 43 is in red )
On the remote computer :
* IIS7 is installed (and also IIS6, I think)
* ASP.NET 4.0 is installed
* "aspnet_regiis -ir" > installed successfully
* IIS7 > Application Pools > ASP.NET 4.0 > poining to ".NET Framework v4.0.30319"
* IIS7 > my web application > "ASP.NET 4.0" (Integrated) is chosen.
I don't know if it 's important but server's windows is Widows Server 2008 RT Enterprise 64-bit and my computer is windows 7 32-bit.
Nothing helped...

The httpRuntime did not have targetFramework available for set, remove it and it will work.

I had similiar issue when I try to publish the website.
The code compiled fine in both Debug and Release but got Unrecognized attribute 'targetFramework'... while publishing the site after updating my solution to .net 4.7.2 from older version .net3.5
I then updated my .pubxml file to contain
**<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>**
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<WebPublishMethod>FileSystem</WebPublishMethod>
It worked for me then

Related

Error occurred during the processing of a configuration file required to service this request

I have copied a client's web application to my C:\inetpub\wwwroot.
I aslo run Aspnet_regiis.exe -i to solve a previous error I was having
Now I have this error:
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: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 31:
Line 32: <compilation debug="true" targetFramework="4.0" />
Line 33: <authentication mode="Forms">
Line 34: <forms loginUrl="~/Default.aspx" timeout="2880" />
Line 35: </authentication>
Source File: C:\inetpub\wwwroot\site\web.config Line: 33
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
I have tried to run the application: http://localhost/site/Default.aspx. How do I fix the error?
Go to your IIS management console, find the directory called site under the Default Web Site (which is under the Sites node), right click on site and choose Convert to Application.

How to create UltiDev Web Server Setup written a web applictaion on asp.net 4.0

I have created a web site on asp.net 4.0 and when I create a set up of this site using UltiDev Web Server the set has been completed successfully and installed and when i run it through shortcut the page show this error
Server Error in '/WebApp' 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 14:
Line 15: <system.web>
Line 16: <compilation debug="true" targetFramework="4.0" />
Line 17:
Line 18: <authentication mode="Forms">
Source File: C:\Program Files (x86)\Microsoft\TestSetup\WebApp\web.config Line: 16
Version Information: Microsoft .NET Framework Version:2.0.50727.5466; ASP.NET Version:2.0.50727.5459
and when i create any app on .net framework 2.0 it work fine ..
I had been creating setup for a long time in .net 2.0
Saad,
When registering a web application with UWS, please be sure to use /CLR:4 parameter to ensure your application is going to be loaded into UWS application host process running .NET Framework 4.x.

Publishing website on IIS error

Hi everyone when i publish my website via IIS, I get this error code as you can see at below. Can you help me ?
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: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 27: </assemblies>
Line 28: </compilation>
Line 29: <authentication mode="Forms">
Line 30: <forms loginUrl="~/Account/LogOn" timeout="2880" />
Line 31: </authentication>
Source File: C:\Users\furkan\Desktop\WebCity\webcity\web.config Line: 29
Then I converted my root dictionary to Application but I get this error
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 17: <system.web>
Line 18: <httpRuntime requestValidationMode="2.0" />
Line 19: <compilation debug="true" targetFramework="4.0">
Line 20: <assemblies>
Line 21: <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Source File: C:\Users\furkan\Desktop\WebCity\WebCity\web.config Line: 19
The answer to the first issue was this:
This usually means you have not configured the directory for your website as an application. Open up IIS Manager, find the root directory for your website (where web.config is), right click, and select "Convert to Application".
For the new issue, it's a problem of the .NET version. You either don't have asp.net 4.0 installed, or you have the application pool set to use the wrong framework. It's probably the latter, so go to the advanced setting for your site, select the Application Pool setting, and choose an Application Pool called ASP.NET 4.0, or any other that uses the 4.0 framework. If there aren't any, then you need to install .NET 4.0
Did you check if you have multiple web.configs in a sub directory somewhere?
Link describing the problem here

Deploy asp.net website in IIS 7.5 locally

I get this error when deploying website in 11s 7.5 :
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: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 16: <compilation debug="true" targetFramework="4.0" />
Line 17:
Line 18: <authentication mode="Forms">
Line 19: <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 20: </authentication>
Source File: C:\Users*\Documents\Visual Studio 2010\Projects\web\web\web.config Line: 18
I am trying to deploy my website locally for testing.
Check out with follwing solution:
Delete the bin and obj folders, run a Clean Solution and built it again, the error goes away.
check the Application Pool the site is running under to make sure the Application Pool is using the .NET 4.0 Framework (instead of .NET 2.0 Framework).

asp.net website on IIS

When I deploy my project to inetpub/wwwroot/ directory, and trying to run my index.aspx file though browser, it shows this error:
Line 44: < authentication mode="Windows" / >
Source File: c:\inetpub\wwwroot\conversion\web.config Line: 44
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.3615; ASP.NET Version:2.0.50727.3618
I don't know what the problem is. How can this be fixed?
IIS version 5.1
You need to look in your web.config file and and change the authentication mode to "None"
<authentication mode="None" />
You can read more about authentication modes and how they work here.

Resources