0

I am running ASP.NET project in my IIS webserver and I am getting this error. Everything worked fine in my localhost server but after uploading my code to server I am getting this kind of error.

My Web.Config file consists of

<?xml version="1.0"?>
<configuration>
<!--    <system.diagnostics>
        <trace autoflush="true" indentsize="0">
            <listeners>
                <!--<add name="MyListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\temp\webmail.log"/>-->
            </listeners>
        </trace>
    </system.diagnostics> -->
    <appSettings>
    <add key="dataFolderPath" value="App_Data\"/>
    <add key="WebMailFolderPath" value=""/>
  </appSettings>
    <system.web>
    <pages enableEventValidation="false" enableViewState="false" enableViewStateMac="false">
    <!--  <controls>
        <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
        <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </controls> -->
    </pages>
        <httpRuntime maxRequestLength="32768" executionTimeout="3600"/>
    <httpHandlers>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
    </httpHandlers>
    <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpModules>
    <compilation defaultLanguage="c#" debug="false">
      <assemblies>
        <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      </assemblies>
    </compilation>
        <customErrors mode="Off" />
        <trace enabled="false" requestLimit="10" pageOutput="false" traceMode="SortByTime" localOnly="true"/>
        <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="1000"/>
        <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
    </system.web>
</configuration>
Karthik Malla
  • 5,570
  • 12
  • 46
  • 89
  • possible duplicate of [Deploying website: 500 - Internal server error](http://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error) – Aristos May 16 '12 at 04:55
  • what are the details of the error? if I had to guess off hand, it's probably the nested comments surrounding system.diagnostics – Tom May 16 '12 at 04:59

2 Answers2

2

I direct see this lines that is not in correct format. You include one commend inside other. Ether remove all lines, ether remove the inside commend.

<!--    <system.diagnostics>
        <trace autoflush="true" indentsize="0">
            <listeners>
                <!--<add name="MyListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\temp\webmail.log"/>-->
            </listeners>
        </trace>
    </system.diagnostics> -->

Also look this answer: https://stackoverflow.com/a/5385884/159270

The 500 Internal Server error, is a general public message that is avoid to give details on the error. What you need to do is to open the public errors to see whats really happens, correct it and close them again.

Community
  • 1
  • 1
Aristos
  • 66,005
  • 16
  • 114
  • 150
0

Add following options in the page directive of the aspx page:

<%@ Page Title="" Language="C#" .... EnableEventValidation="false"
ValidateRequest="false" %>  

That worked out for me.

skakhter
  • 1
  • 2