0

I have a simple HTML web application which works on my browser. When I try to deploy that application on the internet, I get these error.

 To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>

My web.config looks like :

<configuration>
    <system.web>
      <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" />
      <httpRuntime targetFramework="4.5" />
    </system.web>

</configuration>

When I upload, my web.config and web.debug.config also gets uploaded.

My web.debug.config looks like :

<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
  </system.web>
</configuration>

Can you tell me where am I going wrong ?

user1989
  • 217
  • 2
  • 13
  • 1
    To be clear, the `web.config` isn't the thing giving the error. It's telling you how to modify the `web.config` file so that you'll be able to see the error. – mason Mar 15 '15 at 22:39
  • @GrantWinney When I kept that CustomError mode to Off, I get **Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.** – user1989 Mar 15 '15 at 22:40
  • @mason In my local system, everything works fine. – user1989 Mar 15 '15 at 22:40
  • 2
    @user1989 Perhaps your hosting providers environment is different from your local system? If you want the code to work on both systems, you either need to modify your code to work on both, or modify the environments to be similar. In this case, sounds like your hosting provider environment is .NET 2.0 while your local system is .NET 4.0. So either turn your site into a .NET 2.0 site or enable .NET 4.0 in your hosting configuration. See [Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive](http://stackoverflow.com/questions/10630473). – mason Mar 15 '15 at 22:42
  • @mason Yes, they had 2.0, so there was a problem. Its working now. But can you explain me how did you figure out that they had asp.net host only till 2.0 ? – user1989 Mar 15 '15 at 23:21
  • 2
    Because you told me the error message was `Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.`. I searched for that on Stack Overflow and found the question I linked to above, which you should now mark your question a duplicate of. – mason Mar 15 '15 at 23:25

0 Answers0