Reputation: 321
I'm trying to deploy a web application in our college server, but all I get when running the page is "500-Internal server error" (There is a problem with the resource you are looking for, and it cannot be displayed.)
Last time I remember adding something to the web config, but I can't seem to remember what it was. I tried adding:
<customErrors mode="Off">
</customErrors>
But it doesn't seem to fix it.
What should I add to my web config in order to display errors right? so I would know what's wrong.
this is my web config:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<!--show errors on server-->
<customErrors mode="Off">
</customErrors>
<!--connection string-->
<connectionStrings>
<add name="igroup20_test2ConnectionString" connectionString="Data Source=Media.ruppin.ac.il;Initial Catalog=igroup20_test2;User ID=igroup20;Password=****" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<!--define membership-->
<membership defaultProvider="CustomizedProvider">
<providers>
<add name="CustomizedProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="igroup20_test2ConnectionString" applicationName="ScottsProject" minRequiredPasswordLength="4" minRequiredNonalphanumericCharacters="0"/>
</providers>
</membership>
<!--define roles-->
<roleManager enabled="true" defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="igroup20_test2ConnectionString" applicationName="/"/>
</providers>
</roleManager>
<!--define profile properites-->
<profile defaultProvider="CustomProfileProvider" enabled="true">
<providers>
<add name="CustomProfileProvider"
type="System.Web.Profile.SqlProfileProvider"
connectionStringName="igroup20_test2ConnectionString"
applicationName="ScottsProject" />
</providers>
<!-- Define the properties for Profile... -->
<properties>
<add name="prof" type="String" serializeAs="String" />
</properties>
</profile>
<authentication mode="Forms"/>
<compilation debug="true" targetFramework="4.0">
<!--<httpRuntime targetFramework="4.5"/>-->
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<!--handler for the ajaxupload control-->
<httpHandlers>
<add verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</httpHandlers>
</system.web>
<!--handler for the ajaxupload control-->
<system.webServer>
<handlers>
<add name="AjaxFileUploadHandler" verb="*" path="AjaxFileUploadHandler.axd" type="AjaxControlToolkit.AjaxFileUploadHandler, AjaxControlToolkit" />
</handlers>
</system.webServer>
</configuration>
EDIT
I added:
<system.web>
<customErrors mode="Off"/>
<compilation debug="true"/>
</system.web>
and:
<system.webServer>
<httpErrors errorMode="Detailed" />
<asp scriptErrorSentToBrowser="true"/>
<validation validateIntegratedModeConfiguration="false" />
</system.webServer>
but still only internal server error message is shown..
Upvotes: 0
Views: 2115
Reputation: 321
It was an arror with the config file.
<customErrors mode="Off"/>
and
<compilation debug="true">
was duplicate.
Upvotes: 0
Reputation: 1265
As Grant Thomas mentioned, it could be a problem with the config file itself.
Easiest way I've found to determine that is to try and open up part of the configuration through IIS, then if it is an error with the config file, IIS will throw up an error dialog.
So, head into IIS, select the website in question, and try to open one of the config sections, such as .Net Error Pages or Connection Strings, see if you get an error dialog appear.
Upvotes: 1