Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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...

enter image description hereenter image description here

like image 809
TamarG Avatar asked Jul 07 '13 08:07

TamarG


2 Answers

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

like image 143
Aristos Avatar answered Sep 19 '22 10:09

Aristos


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

like image 44
Amit Sharma Avatar answered Sep 19 '22 10:09

Amit Sharma