Problem med web.config

.NET

3 svar · 2 027 visningar · startad av liverpool

Medlem sedan nov. 200468 inlägg
Trådstart#1

Hej

Min sida funkar jättebra på min dator. Men när jag skall lägga upp sidan på loopias server får jag detta felmeddelandet:

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>

Min web.config fil ser ut såhär.


<?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>
   
       <connectionStrings>
      <add name="ConnectionString1" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;data source=" + HttpContext.Current.Server.MapPath("..\..\data\medlem.mdb"); providerName="System.Data.Odbc"/>      
    </connectionStrings>
    <system.web>
      <customErrors mode="On" defaultRedirect="default.asp"/>
      <trace enabled="true" localOnly="false" />
        <compilation debug="true" strict="true" 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"/>
        </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>

         .. mer kod
</configuration>
Medlem sedan maj 20031 173 inlägg
#2

Det är väl bara en standardsida som visas istället för att visa dig själva felet. om du sätter customErrors mode till "off" i din fil så kommer du se det riktiga felmedelandet.

Medlem sedan nov. 200468 inlägg
#3

Nope samma problem.

Medlem sedan nov. 20011 551 inlägg
#4

ändra
<customErrors mode="On" defaultRedirect="default.asp"/>

till
<customErrors mode="Off"/>
så ser du vad som är fel

255 ms totalt · 4 externa anrop · v20260731065814-full.d34c6d5a
129 ms — deklarationer (db)
0 ms — hämta statistik (cache)
123 ms — hämta tråd, inlägg och bilagor (db)
129 ms — ändringar (db)