30. august 2004 - 10:41Der er
64 kommentarer og 1 løsning
Hvis fejl i asp.net
Hej Jeg har lavet en side med en fejl på, og jeg har en remote webserver hvor den her side ligger på. Når jeg så kører den her side på min web server laver den en fejl. men fejlen kommer bare ikke ud som en fejl kode men som et eller andet jeg skal ændre i min web.config Hvordan er det lige jeg ændre det? så min fejl kode kommer ud på skræmen
I dette særtema om aspekter af AI ser vi på skiftet fra sprogmodeller til AI-agenter, og hvordan virksomheder kan navigere i spændet mellem teknologisk hastighed og behovet for menneskelig kontrol.
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".
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.
okey den fik jeg ik lige, nu har jeg skrivet <customErrors mode="Off" defaultRedirect="mycustompage.htm"/> i min web.config men det virker stadig væk ikke
<!-- DYNAMIC DEBUG COMPILATION Set compilation debug="true" to enable ASPX debugging. Otherwise, setting this value to false will improve runtime performance of this application. Set compilation debug="true" to insert debugging symbols (.pdb information) into the compiled page. Because this creates a larger file that executes more slowly, you should set this value to true only when debugging and to false at all other times. For more information, refer to the documentation about debugging ASP.NET files. --> <compilation defaultLanguage="c#" debug="true" />
<!-- CUSTOM ERROR MESSAGES Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable. Add <error> tags for each of the errors you want to handle.
"On" Always display custom (friendly) messages. "Off" Always display detailed ASP.NET error information. "RemoteOnly" Display custom (friendly) messages only to users not running on the local Web server. This setting is recommended for security purposes, so that you do not display application detail information to remote clients. -->
<!-- AUTHENTICATION This section sets the authentication policies of the application. Possible modes are "Windows", "Forms", "Passport" and "None"
"None" No authentication is performed. "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to its settings for the application. Anonymous access must be disabled in IIS. "Forms" You provide a custom form (Web page) for users to enter their credentials, and then you authenticate them in your application. A user credential token is stored in a cookie. "Passport" Authentication is performed via a centralized authentication service provided by Microsoft that offers a single logon and core profile services for member sites. --> <authentication mode="Windows" />
<!-- AUTHORIZATION This section sets the authorization policies of the application. You can allow or deny access to application resources by user or role. Wildcards: "*" mean everyone, "?" means anonymous (unauthenticated) users. -->
<authorization> <allow users="*" /> <!-- Allow all users --> <!-- <allow users="[comma separated list of users]" roles="[comma separated list of roles]"/> <deny users="[comma separated list of users]" roles="[comma separated list of roles]"/> --> </authorization>
<!-- APPLICATION-LEVEL TRACE LOGGING Application-level tracing enables trace log output for every page within an application. Set trace enabled="true" to enable application trace logging. If pageOutput="true", the trace information will be displayed at the bottom of each page. Otherwise, you can view the application trace log by browsing the "trace.axd" page from your web application root. --> <trace enabled="true" requestLimit="10" pageOutput="true" traceMode="SortByTime" localOnly="true" />
<!-- SESSION STATE SETTINGS By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". --> <sessionState mode="InProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes" cookieless="false" timeout="20" />
<!-- GLOBALIZATION This section sets the globalization settings of the application. --> <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
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".
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.
det er ikke så meget et spørgsmål om hvad du retter det i... det er mere et spørgsmål om hvor du gemmer det, for det er tilsyneladende ikke gået op for dit webhotel at du har foretaget rettelserne.
hm, nej når jeg omdøber den mappe som det ligger i så laver den stadig samme fejl.
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".
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.
det skal nok lige skrives at det ikke er et web hotel men en privat web server, og jeg ændre bare navnet på mappen. Før hed urlen http://minwebserver/mappe og nu hedder den bare http://minwebserver/mappe1
hvis du så har et virtual directory under default web, kan du højreklikke på det, og se hvilken folder på disken (hvis det er sat sådan op) der peges op.
hvis du bruger visual studio til at oprette et webprojekt, vil det som standard bliver lagt i : C:\inetpub\wwwroot\<projektnavn>, og der vil automatisk blive oprettet et virtual directory i iis-en med samme navn (altså <projektnavn>). det konfigureres som applikation og peger på førnævnte fysiske folder, som du så kan nå ved at hitte : http://localhost/<projektnavn>
okey, jeg har en computer hvor jeg har installer Microsoft Visual Studio .NET 2003, hvor jeg skriver filerne, også har jeg en computer som bliver brugt til web server (windows 2003) hvordan gør jeg så, så den selv opretter mapper og filer på web server
du sørger for, at når du har udvilket noget du gerne vil frigive til den anden maskine, at du markerer projektet i din solution - går op i menuen Project, og klikker på Copy Project. Der kan du så vælge at distribuere din applikation til et andet site.. Du kan vælge at gøre det med frontpage-extensions, eller ved almindelig fileshare. desuden kan du angive hvor stor en del af dit projekt der skal distribueres, og som et minimun skal du der vælge "only files needed to run this application".
Så skulle du gerne få smidt din komplette konfiguration ud på siden... Så kan vi jo se hvad der står der... du skal lige have et par using's ind i toppen :
using System.Collections; using System.Collections.Specialized;
hm det fatter jeg ik lige, når jeg har skrivet den her kode så, laver den fejl
fra min webform1.aspx.cs
using System; using System.Collections; using System.Collections.Specialized; using System.ComponentModel; using System.Data; using System.Drawing; using System.Web; using System.Web.SessionState; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls;
namespace info { /// <summary> /// Summary description for WebForm1. /// </summary> public class WebForm1 : System.Web.UI.Page { private void Page_Load(object sender, System.EventArgs e) { NameObjectCollectionBase.KeysCollection kCol = ConfigurationSettings.AppSettings.Keys; Table tbl = new Table(); TableCell tc; TableRow tr; Label lbl;
for(int i=0; i<kCol.Count; i++) { tr = new TableRow(); tc = new TableCell(); lbl = new Label();
#region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load);
Server Error in '/info' 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".
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.
ja okey min fejl, men den laver stadig en runtime error på webserver, og når jeg trykker f5 på visu så kommer den med en fejl om at mit debugging ikke er installet rigtig
ikke installeret rigtigt... så er der da noget helt galt med din vs-installation... er du sikker på at det er det den skriver ? (er det ikke noget med at projektet ikke er konfigureret til debugging)
ellers så prøv at se hvad der sker hvis du trykker CTRL+F5 (så skulle den starte op uden debugging)
hvis jeg skriver Response.Write("dav"); inde i loopet så kommer den ikke ud, men hvis jeg skriver Response.Write("hej"); efter loopet så kommer den godt nok frem når jeg trykker ctrl + F5
så kom der noget nyt frem på skræmen, jeg har lavet et nyt prok. oppe på min webserver "t1" taget min fil hvor jeg åbener min database og sat ind kopiet <customErrors mode="Off" defaultRedirect="mycustompage.htm"/> over i min web.config
og laver den den her fejl:
Server Error in '/t1' Application. --------------------------------------------------------------------------------
Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 't1.Global'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="t1.Global" %>
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Server Error in '/t1' Application. --------------------------------------------------------------------------------
SQL Server does not exist or access denied. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[SqlException: SQL Server does not exist or access denied.] System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction) +472 System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction) +372 System.Data.SqlClient.SqlConnection.Open() +384 turning.WebForm1.Page_Load(Object sender, EventArgs e) in \\sqlserver\wwwroot$\t1\webform1.aspx.cs:25 System.Web.UI.Control.OnLoad(EventArgs e) +67 System.Web.UI.Control.LoadRecursive() +35 System.Web.UI.Page.ProcessRequestMain() +731
-------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
så virker det jeg sprøge også om.... for nu vister den fejl når jeg kalder filen fra min webserver
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.