简体   繁体   中英

Getting web.config error when publishing my ASP.Net website

I'm trying to publish my first ASP.Net website, but I'm getting this error when I try to visit the homepage.

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

Here's the section of the web.config file it is referencing:

  <system.web>
    <customErrors mode="Off" />
    <compilation debug="true" targetFramework="4.5.2" />
    <httpRuntime targetFramework="4.5.2" />
  </system.web>

And here's the website itself if you want to see the full error page:

http://connellchamberofcommerce.com/

Is the ASP.Net version (4.5.2) supposed to match the .Net version my host uses or something? As I said, this is my first ASP.Net website and I'm pretty confused by this error.

The version information at the bottom of http://connellchamberofcommerce.com/ indicates that the .net version of app pool is 2.0.50727.5491, where as in your web.config file its 4.5.2. So change the app pool to use 4.0.

Your web.config looks fine to me. My guess would be that you have set the wrong .NET version in the AppPool under which your site is running.

Go to your IIS -> Select your desired AppPool -> Click Basic settings and change the .Net version accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM