Solved

Server Error in '/' Application.

Posted on 2009-04-15
18
756 Views
Last Modified: 2012-05-06
Hi I am reciving the error below.

Server Error in '/' Application.
Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: 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>

 

 

    *  I have added what it suggests to the web.config file.

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

 Can anyone shed any light on why I am reciveing this error, desipte:

    * Adding the required code "<customErrors mode="Off"/>" to the web.config to view the error (which i cannot see).
    * My host has set the application directory for asp.net so I have full control to the asp.net account on my domian folder.
    * The application works perfect on my local machine. The error only shows remotly.
    * Also, the web.config and required BIN files are located in the root

Any ideas as to what the problem may be? Does anyone know how I can locate this problem on my local machine is i very frustarting knowing there is a problem but not being able to find out what it is to fix it?



The web.config is in the code below.

 

Thanks.


<?xml version="1.0"?>

<!--

    Note: As an alternative to hand editing this file you can use the

    web admin tool to configure settings for your application. Use

    the Website->Asp.Net Configuration option in Visual Studio.

    A full list of settings and comments can be found in

    machine.config.comments usually located in

    \Windows\Microsoft.Net\Framework\v2.x\Config

-->

<configuration>

    <configSections>

        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">

                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>

                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>

                </sectionGroup>

            </sectionGroup>

        </sectionGroup>

    </configSections>

    <appSettings/>

 

 

 

  <connectionStrings>

    <add name="DB" connectionString="DETAILS OF CONNECTION"/>

    <remove name="LocalSqlServer"/>

    <add name="LocalSqlServer" connectionString="DETAILS OF CONNECTION "/>

  </connectionStrings>

 

 

 

  <system.web>

 

    <!--CUSTOM ERROR PAGES OFF-->

 

    <customErrors mode="Off"/>

 

    <membership>

      <providers>

        <remove name="AspNetSqlMembershipProvider"/>

        <add name="AspNetSqlMembershipProvider"

             type="System.Web.Security.SqlMembershipProvider"

             connectionStringName="LocalSqlServer"

             enablePasswordRetrieval="False" enablePasswordReset="True"

             requiresQuestionAndAnswer="False"

             applicationName="/"

             requiresUniqueEmail="false"

             passwordFormat="Clear"

             maxInvalidPasswordAttempts="10"

             minRequiredPasswordLength="1"

             minRequiredNonalphanumericCharacters="0"

             passwordAttemptWindow="10"/>

      </providers>

    </membership>

   

   

    <authorization>

      <allow users="?" />

    </authorization>

    <compilation debug="true" strict="false" explicit="true">

            <assemblies>

                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>

                <add assembly="System.Web.Extensions.Design, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies>

        </compilation>

       

   

    <pages>

            <namespaces>

                <clear/>

                <add namespace="System"/>

                <add namespace="System.Collections"/>

                <add namespace="System.Collections.Generic"/>

                <add namespace="System.Collections.Specialized"/>

                <add namespace="System.Configuration"/>

                <add namespace="System.Text"/>

                <add namespace="System.Text.RegularExpressions"/>

                <add namespace="System.Linq"/>

                <add namespace="System.Xml.Linq"/>

                <add namespace="System.Web"/>

                <add namespace="System.Web.Caching"/>

                <add namespace="System.Web.SessionState"/>

                <add namespace="System.Web.Security"/>

                <add namespace="System.Web.Profile"/>

                <add namespace="System.Web.UI"/>

                <add namespace="System.Web.UI.WebControls"/>

                <add namespace="System.Web.UI.WebControls.WebParts"/>

                <add namespace="System.Web.UI.HtmlControls"/>

            </namespaces>

            <controls>

                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            </controls>

        </pages>

 

        <!--

            The <authentication> section enables configuration

            of the security authentication mode used by

            ASP.NET to identify an incoming user.

        -->

        <authentication mode="Forms" />

        <!--

            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>

        -->

 

    <httpHandlers>

            <remove verb="*" path="*.asmx"/>

            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

        </httpHandlers>

        <httpModules>

            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        </httpModules>

    </system.web>

 

 

 

 

  <system.codedom>

        <compilers>

            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

                <providerOption name="CompilerVersion" value="v3.5"/>

                <providerOption name="WarnAsError" value="false"/>

            </compiler>

            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

                <providerOption name="CompilerVersion" value="v3.5"/>

                <providerOption name="OptionInfer" value="true"/>

                <providerOption name="WarnAsError" value="false"/>

            </compiler>

        </compilers>

    </system.codedom>

    <!--

        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.

    -->

    <system.webServer>

        <validation validateIntegratedModeConfiguration="false"/>

        <modules>

            <remove name="ScriptModule"/>

            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        </modules>

        <handlers>

            <remove name="WebServiceHandlerFactory-Integrated"/>

            <remove name="ScriptHandlerFactory"/>

            <remove name="ScriptHandlerFactoryAppServices"/>

            <remove name="ScriptResource"/>

            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

        </handlers>

    </system.webServer>

    <runtime>

        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

            <dependentAssembly>

                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>

                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

            </dependentAssembly>

            <dependentAssembly>

                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>

                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>

            </dependentAssembly>

        </assemblyBinding>

    </runtime>

 <system.net>

  <mailSettings>

   <smtp from="">

    <network host="" password="" userName="" />

   </smtp>

  </mailSettings>

 </system.net>

</configuration>

Open in new window

0
Comment
Question by:ieuanfawr
  • 5
  • 5
  • 3
  • +2
18 Comments
 
LVL 14

Expert Comment

by:GiftsonDJohn
ID: 24147719
Hi,

adding <customErrors mode="Off"/> to web.config allows the users to view the detailed error message from the web server. if you put

<customErrors mode="On" defaultRedirect="Error.aspx">
                  <error statusCode="404" redirect="FileNotFound.aspx"/>
                  <error statusCode="401" redirect="Unauthorized.aspx"/>
</customErrors>

if any error happens it will redirect to the specified redirect url based on the status code and the detailed error message from compiler will not be shown.

<customErrors mode="RemoteOnly" behaves same as mode="On" the only difference is the detailed error message will be visible only on the local system (i.e. the web server). Client system will see the redirected pages.
0
 
LVL 20

Expert Comment

by:informaniac
ID: 24147737
<!--
            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>
        -->
Line 110. Remove the comments here...
0
 

Author Comment

by:ieuanfawr
ID: 24147751
You have misunderstood the problem.

    *  I have added what it suggests to the web.config file.

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

It still does not show the error. Still shows the same error "Server Error in '/' Application."

 Can anyone shed any light on why I am reciveing this error, desipte:

    * Adding the required code "<customErrors mode="Off"/>" to the web.config to view the error (which i cannot see).
    * My host has set the application directory for asp.net so I have full control to the asp.net account on my domian folder.
    * The application works perfect on my local machine. The error only shows remotly.
    * Also, the web.config and required BIN files are located in the root

Any ideas as to what the problem may be? Does anyone know how I can locate this problem on my local machine is i very frustarting knowing there is a problem but not being able to find out what it is to fix it?
0
 
LVL 14

Expert Comment

by:GiftsonDJohn
ID: 24147775
After you made the changes like <customErrors mode="Off"/> you will receive a detailed compiler output and error message. Please post it. It will be helpful to debug the error.
0
 

Author Comment

by:ieuanfawr
ID: 24147800
That is what  im trying to say...

I have added the <customErrors mode="Off"/> to the web.config and the  real error is still not showing - just the page asking me to add <customErrors mode="Off"/> even tho I have!!!.

There is a copy of the web.config above, if you can shed any light on why its not working?

Thanks.
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24147833
You could create a customError page and use it to display the exception information

If that doesn't make a difference, then you've got a compile error due to the server being configured differently.
<!-- In Web.Config>

<customErrors defaultRedirect="/error.aspx" mode="RemoteOnly" redirectMode="ResponseRewrite" />
 

<!-- Create error.aspx in / -->

<%@ Page Language="C#" ContentType="text/plain" %>
 

<script runat="server">

  protected void Page_Load(object sender, EventArgs e) {

    Exception ex = Server.GetLastError().GetBaseException();

    Response.Clear();

    Response.Write(ex.Message + "\n\n");

    Response.Write(ex.StackTrace);

  }

</script>

Open in new window

0
 
LVL 14

Expert Comment

by:GiftsonDJohn
ID: 24147869
Do you have more than 1 version of .net frameworks installed in your system?
0
 

Author Comment

by:ieuanfawr
ID: 24148063
Hi,

The web app. works perfect on my local machine. As soon as i transfer the files to my remote server the error occurs.

I have added the code <customErrors mode="Off"/>  and yet the exact does not show. Still shows the same error "Server Error in '/' Application."

I only have 1 verson of the .net framework installed on my system.

As i say,

    * My host has set the application directory for asp.net so I have full control to the asp.net account on my domian folder.
    * Also, the web.config and required BIN files are located in the root

So i dont understand why it is not working!!!
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 15

Expert Comment

by:oobayly
ID: 24148258
OK, just tested something on one of my domains. Introduced an error into my web.config, and I get a similar error to what you're reporting. If there's an error in the web.config, the of course the server doesn't know that it should be displaying full errors.
Even if everything works on your local machine, it doesn't mean that the server is configured the same.
For example, you've referenced Linq, which is .Net 3.0 and above. As you appear to be using a hosted solution is it possible that your hosts haven't got .Net 3.0 on the server yet. To be honest I haven't upgraded to .Net 3.0 / 3.5 on my server yet.
0
 

Author Comment

by:ieuanfawr
ID: 24148569
I dont know what to do - well an truly stumped. Got a web site here ready to deploy, all works well on local machine, but have fallen at the first hurdle when deploying due to this error and its very frustarting.

I know for a fact that my host has the same configuration as my local machine as i have other sites that i have developed and deployed with no problem at all on the same host. In fact, one is on a sub domian of the domain I am trying to add this site to.

Can anyone offer any advice as i have no idea how to resolve this issue...

The web.config file is above.

Many Thanks.
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24148761
All I can suggest is to start commenting out chunks of your web.config until you find what the cause of the problem is
0
 
LVL 20

Expert Comment

by:informaniac
ID: 24184237
Well. Looks like u r not seeing what I'm trying to say.

I said there is a section in the web.config file that has the customErrors tag.

Just remove the comments surrounding it, instead of adding a tag. And then plz check
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24184409
@informaniac
Can you explain why the customErrors element should be affected by its position in the system.web element?
0
 
LVL 20

Expert Comment

by:informaniac
ID: 24222376
That's the way it behaved with me. That's why I suggested that.
0
 
LVL 15

Expert Comment

by:oobayly
ID: 24223059
Fair enough, I'd assumed it was from past experience. Wasn't sure if there was a rational other than I've tried it and it works. The things we have to live with as developers :-)
0
 

Accepted Solution

by:
ieuanfawr earned 0 total points
ID: 24245420
Hello all,

 Thanks for your input.

 I have now resolved this issue.

The problem lied with my host after all. By default, the ASP.NET settings are set to 1.1. Simply changing the ASP.NET settings to 2.0 resolved this issue.

 

I would suggest that anyone who has the the follow:

    * Added the required code "<customErrors mode="Off"/>" to the web.config to view the error (which i cannot see).
    * Host has set the application directory for asp.net so I have full control to the asp.net account on my domian folder.
    * The application works perfect on my local machine. The error only shows remotly.
    * web.config and required BIN files are located in the root

  and is still recieving the error "Server Error in '/' Application" to check that there host is currently running ASP.NET 2.0.

 As I say, simply changing it from 1.1 to 2.0 in my hosting control instantly resolved this issue.

 

Thanks again.
0
 

Expert Comment

by:akohan
ID: 34253567

Very helpful.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now