Salve,
sono alle prime armi con la programmazione ASP .NET. Sotto Windows 2003 Server, e usando Visual Studio 2003, non riesco ad aprire, da IIS, una pagina HelloWorld.aspx che contiene il codice seguente:
<%@ page language="C#" Debug="true" %>
<html>
<head>
<title></title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
in quanto viene aperto il browser Internet Explorer che visualizza una pagina il cui codice è (lo riporto non potendo inserire file allegati):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://localhost/ASPNETStepbyStep/HelloWorld.aspx -->
<HTML><HEAD><TITLE>Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE>BODY {
FONT-WEIGHT: normal; FONT-SIZE: 0.7em; COLOR: black; FONT-FAMILY: "Verdana"
}
P {
MARGIN-TOP: -5px; FONT-WEIGHT: normal; COLOR: black; FONT-FAMILY: "Verdana"
}
B {
MARGIN-TOP: -5px; FONT-WEIGHT: bold; COLOR: black; FONT-FAMILY: "Verdana"
}
H1 {
FONT-WEIGHT: normal; FONT-SIZE: 18pt; COLOR: red; FONT-FAMILY: "Verdana"
}
H2 {
FONT-WEIGHT: normal; FONT-SIZE: 14pt; COLOR: maroon; FONT-FAMILY: "Verdana"
}
PRE {
FONT-SIZE: 0.9em; FONT-FAMILY: "Lucida Console"
}
.marker {
FONT-WEIGHT: bold; COLOR: black; TEXT-DECORATION: none
}
.version {
COLOR: gray
}
.error {
MARGIN-BOTTOM: 10px
}
.expandable {
FONT-WEIGHT: bold; CURSOR: hand; COLOR: navy; TEXT-DECORATION: underline
}
</STYLE>
<META content="MSHTML " name=GENERATOR></HEAD>
<BODY bgColor=white><SPAN>
<H1>Server Error in '/ASPNETStepbyStep' Application.
<HR width="100%" color=silver SIZE=1>
</H1>
<H2>Server cannot access application directory 'D:\Documents and
Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does
not exist or is not accessible because of security settings.
</H2></SPAN><FONT
face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><B>Description:
</B>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. <BR><BR><B>Exception Details:
</B>System.Web.HttpException: Server cannot access application directory
'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'.
The directory does not exist or is not accessible because of security
settings.<BR><BR><B>Source Error:</B> <BR><BR>
<TABLE width="100%" bgColor=#ffffcc>
<TBODY>
<TR>
<TD>
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.
</TD></TR></TBODY></TABLE><BR><B>Stack Trace:</B> <BR><BR>
<TABLE width="100%" bgColor=#ffffcc>
<TBODY>
<TR>
<TD>
<PRE>
[HttpException (0x80004005): Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +964
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
</PRE>
</TD></TR></TBODY></TABLE><BR>
<HR width="100%" color=silver SIZE=1>
<B>Version Information:</B> Microsoft .NET Framework Version:;
ASP.NET Version: </FONT><!--
[HttpException]: Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.
at System.Web.HttpRuntime.EnsureAccessToApplicationDirectory()
at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
[HttpException]: ASP.NET Initialization Error
at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
--></BODY></HTML>
Basta copiare il contenuto e salvarlo come file .htm per visualizzarlo correttamente. La directory virtuale esiste e contiene il file HelloWorld.aspx. Accedo come amministratore ed ho tutti i permessi sull'applicazione Helloworld che ho creato.
Non ci sono problemi se invece provo ad aprire una pagina html. Sembra quindi che non sia possibile eseguire il codice <%@ page language="C#" Debug="true" %> perchè da qualche parte non ne verrebbe consentita l'esecuzione...Spero di ricevere un aiuto util, saluti.
sono alle prime armi con la programmazione ASP .NET. Sotto Windows 2003 Server, e usando Visual Studio 2003, non riesco ad aprire, da IIS, una pagina HelloWorld.aspx che contiene il codice seguente:
<%@ page language="C#" Debug="true" %>
<html>
<head>
<title></title>
</head>
<body>
<h1>Hello world!</h1>
</body>
</html>
in quanto viene aperto il browser Internet Explorer che visualizza una pagina il cui codice è (lo riporto non potendo inserire file allegati):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0049)http://localhost/ASPNETStepbyStep/HelloWorld.aspx -->
<HTML><HEAD><TITLE>Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<STYLE>BODY {
FONT-WEIGHT: normal; FONT-SIZE: 0.7em; COLOR: black; FONT-FAMILY: "Verdana"
}
P {
MARGIN-TOP: -5px; FONT-WEIGHT: normal; COLOR: black; FONT-FAMILY: "Verdana"
}
B {
MARGIN-TOP: -5px; FONT-WEIGHT: bold; COLOR: black; FONT-FAMILY: "Verdana"
}
H1 {
FONT-WEIGHT: normal; FONT-SIZE: 18pt; COLOR: red; FONT-FAMILY: "Verdana"
}
H2 {
FONT-WEIGHT: normal; FONT-SIZE: 14pt; COLOR: maroon; FONT-FAMILY: "Verdana"
}
PRE {
FONT-SIZE: 0.9em; FONT-FAMILY: "Lucida Console"
}
.marker {
FONT-WEIGHT: bold; COLOR: black; TEXT-DECORATION: none
}
.version {
COLOR: gray
}
.error {
MARGIN-BOTTOM: 10px
}
.expandable {
FONT-WEIGHT: bold; CURSOR: hand; COLOR: navy; TEXT-DECORATION: underline
}
</STYLE>
<META content="MSHTML " name=GENERATOR></HEAD>
<BODY bgColor=white><SPAN>
<H1>Server Error in '/ASPNETStepbyStep' Application.
<HR width="100%" color=silver SIZE=1>
</H1>
<H2>Server cannot access application directory 'D:\Documents and
Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does
not exist or is not accessible because of security settings.
</H2></SPAN><FONT
face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif "><B>Description:
</B>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. <BR><BR><B>Exception Details:
</B>System.Web.HttpException: Server cannot access application directory
'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'.
The directory does not exist or is not accessible because of security
settings.<BR><BR><B>Source Error:</B> <BR><BR>
<TABLE width="100%" bgColor=#ffffcc>
<TBODY>
<TR>
<TD>
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.
</TD></TR></TBODY></TABLE><BR><B>Stack Trace:</B> <BR><BR>
<TABLE width="100%" bgColor=#ffffcc>
<TBODY>
<TR>
<TD>
<PRE>
[HttpException (0x80004005): Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.]
System.Web.HttpRuntime.EnsureAccessToApplicationDirectory() +72
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +263
[HttpException (0x80004005): ASP.NET Initialization Error]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +964
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +128
</PRE>
</TD></TR></TBODY></TABLE><BR>
<HR width="100%" color=silver SIZE=1>
<B>Version Information:</B> Microsoft .NET Framework Version:;
ASP.NET Version: </FONT><!--
[HttpException]: Server cannot access application directory 'D:\Documents and Settings\Administrator\My Documents\Visual Studio Projects\'. The directory does not exist or is not accessible because of security settings.
at System.Web.HttpRuntime.EnsureAccessToApplicationDirectory()
at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
[HttpException]: ASP.NET Initialization Error
at System.Web.HttpRuntime.FirstRequestInit(HttpContext context)
at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
--></BODY></HTML>
Basta copiare il contenuto e salvarlo come file .htm per visualizzarlo correttamente. La directory virtuale esiste e contiene il file HelloWorld.aspx. Accedo come amministratore ed ho tutti i permessi sull'applicazione Helloworld che ho creato.
Non ci sono problemi se invece provo ad aprire una pagina html. Sembra quindi che non sia possibile eseguire il codice <%@ page language="C#" Debug="true" %> perchè da qualche parte non ne verrebbe consentita l'esecuzione...Spero di ricevere un aiuto util, saluti.