17. november 2003 - 12:46Der er
26 kommentarer og 1 løsning
Fejl efter upload på serveren
Jeg har lavet en webservice der fungerer fint på min lokale maskine, når nu jeg har lagt den op på serveren og jeg skal til at forbinde fra min webformf får jeg følgende 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.
Jyske Bank er rykket ind i Glaskuben på Kalvebod Brygge, et markant byggeri i hjertet af København. Knap 1.000 arbejder her, heraf 200 i IT, med nye rammer for samarbejde, innovation og udvikling.
<!-- 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. --> <customErrors mode="Off" />
<!-- 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="false" requestLimit="10" pageOutput="false" 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" />
gulbaek: Hvorfor skulle det virke blot pga. en anden web.config? Hvad med Pernilles specielle indstillinger og config-settings. Hvem siger encoding skal være utf osv ? Det primære er at vi skal have den rigtige debug information, og det gøres med det som gulbaek skriver, og ikke den lange VS.NET-genererede smøre.
gulbaek, det har jeg nu prøvet det virker stadig ikke :o( Jeg faldt over det her: [WebService(Namespace="http://xnetdev.newtech.dk")] som skal skrives inde i asmx filen lige over klassen, kan det være sådan noget?
Ja det er til at beskrive servicen med, men næppe problemet. Du har vel erklæret webservices klasser og funktioner med <> ? ex.
[WebService (Name:="MinService", Description:="Generel beskrivelse af alle services", Namespace:="http://www.hugohej.dk/webservice.asmx")]> public class minWebservice ...
[WebMethod (Description:="Beskrivelse af service")> public string minFunktion() ...
men du er altså nødt til at slå debugging til først. Ellers kan vi bruge resten af ugen på at gætte hvad der er galt, i stedet for at få fejlen præcist beskrivet. Der må være noget galt med din web.config hvis du stadig får den fejl.
Jeg ved ikke lige hvad du mener med hvor jeg har placeret hvilken fil, men her er min web.config: <?xml version="1.0" encoding="utf-8" ?> <configuration>
<!-- 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. --> <customErrors mode="RemoteOnly" />
<!-- 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="None" />
<!-- 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="false" requestLimit="10" pageOutput="false" 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" />
Så længe du ikke få en fejlbesked om at det er den fil det er galt med, så er det web.config den er gal med. Istedet for at benytte den lange web.config, så skriv den korte som gulbaek skrev ALLER først. Det er ikke til at se om der skulle være en lille fejl i web.config som genererer fejlen (hvilket det jo nok er eftersom CustomErrors er sat til off).
Til info kan jeg oplyse, at jeg fik helt samme fænomen i dag: ligegyldugt hved jeg gjorde, reflekteredes ikke over indholdet i web.config. Det opstod på følgende måde:
1/ Jeg havde navngivet et bibliotek på wedserveren således: Bib II (altså med mellemrum) 2/ Kørsel af Default.aspx forløb uden problemer 3/ Jeg ændrede navnet til BibII 4/ Kørsel af Default.aspx forløb tilsyneladende normalt (ingen melding om at ressource ikke kan findes), men med ovennævnte fejlbesked helt hårdnakket.
Det tog lidt tid at afklare dette!!!
Synes godt om
Ny brugerNybegynder
Din løsning...
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.