Forum > ASP.NET 1.x och 2.x > Generella frågor
Hej!
Sitter nu här och försöker få igång min nya sida. Men har problem med min web.config fil ibland.
Om du går in på, http://vaxjofaktning.se/Pictures.aspx , så ser du att jag får ett runtime error.
Min web.config fil ser ut som följande.
<?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>
<appSettings />
<connectionStrings />
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" />
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows" />
<!--
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="Off" />
</system.web>
</configuration>
Det kommer även samma error när jag försöker logga in.
<authentication mode="Forms" />Testa med det?
mode="windows" brukar man köra med när man gör det localhost och mode="forms" på webbservern.
Jag får också samma error, även om jag sätter mode till forms. Jag har även ändrat till
<customErrors mode="Off" defaultRedirect="GenericErrorPage.htm">
Men utan resultat.
Jag har hört något om att .NET sidor behöver något fix med virtuella mappar, är det bara något någon ha lurat i mig eller är det fakta? Isåfall hur?
Jo det är sant att visa sidor behöver en så kallad virtuell mapp för att fungera.
Får som Shadi redan sagt samma fel med med mode="forms".
Det fungerar ju när man inte gör något på själva sidan, alltså inte kör något som ligger i .aspx.cs filen.
Vad är det för virutell mapp ni snackar om? Någon länk till nån tut på det?
När man använder en web.config i en katalog, så förväntas katalogen vara en "Application" i IIS.
Öppna IIS Manager. Bläddra fram till aktuell mapp. Högerklicka på den och välj Properties.
Klicka på knappen Create. Klicka OK. Och vips! så borde det fungera.