0
 <?xml version="1.0"?>
<configuration>
    <appSettings>
        <add key="ConnectionInfo" value="server=127.0.1.1;database=Info_mgmt;Integrated Security=SSPI"/>
    </appSettings>
    <connectionStrings>
        <add name="Info_mgmtConnectionString" connectionString="Data Source=daffodils\sqlexpress;Initial Catalog=Info_mgmt;Integrated Security=True" providerName="System.Data.SqlClient"/>
    </connectionStrings>
    <system.web>
        <compilation debug="true" targetFramework="4.0">
        </compilation>
        <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
        <authentication mode="Windows"/>
        <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
        <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
    <!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
</configuration>

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 7: Line 8: Line 9: Line 10: Line 11:

Source File: D:\Infopass\Infopass-Web\Infopass-Web\web.config Line: 9

4
  • Please show the part of the configuration file that causes the error. There is no targetFramework attribute in the code shown. Commented Feb 6, 2011 at 15:01
  • I am running in Visual Studio .. Commented Feb 10, 2011 at 7:18
  • <compilation debug="true" targetFramework="4.0"> here error is coming Commented Feb 10, 2011 at 7:19
  • Please see the update to my answer below. Hope that helps. Commented Feb 11, 2011 at 21:56

2 Answers 2

4

The targetFramework attribute is specified on the <compilation> element under <system.web>. I have seen that error message when running sites in IIS 7.5 using ASP.NET 2.0 instead of ASP.NET 4.0. If this site is in IIS, then 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).

Similarly, if you are attempting to run the site from the default web server in Visual Studio and you are seeing this error, you'll want to make sure the Target Framework for the project is set to .NET Framework 4.0 (under Properties > Build > Target Framework).

Sign up to request clarification or add additional context in comments.

1 Comment

I can provide more detail as to what to look for, but can you update the question with the web server you are using? IIS6, IIS7, the built in ASP.NET web server?
1

You need to set your application to use .Net 4.0 in IIS.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.