Hi Imar,
I'm very excited about ASP.NET 2.0 instant results but I'm having some trouble getting started.
I am using: Windows XP, IIS 5.1, .Net Framework 2.0, express editions of SQL Server and Visual Web Developer 2005.
This is what I did:
I copied the
Chapter 01 - Online Diary folder to My Documents.
I opened Internet Information Services.
Action>New>Virtual Directory...
I browsed to the folder C:\Documents and Settings\lf\My Documents\Chapter 01 - Online Diary
I chose an alias of test1
I then entered the URL into my browser:
http://localhost/test1/SignOn.aspx
IIS chugs for a while and returns this:
Server Application Unavailable
The web application you are attempting to access on this web server is currently unavailable. Please hit the "Refresh" button in your web browser to retry your request.
Administrator Note: An error message detailing the cause of this specific request failure can be found in the application event log of the web server. Please review this log entry to discover what caused this error to occur.
I went into Control Panel > Administrative Tools > Event Viewer
There were events that matched the time:
An error which didn't help much:
ERROR
aspnet_wp.exe (PID: 708) stopped unexpectedly.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
And a warning which perplexed me:
WARNING
Event Type: Warning
Event Source: ASP.NET 2.0.50727.0
Event Category: None
Event ID: 1073
Date: 26/01/2008
Time: 9:59:14 PM
User: N/A
Computer: LF
Description:
Failed to initialize the AppDomain:/LM/W3SVC/1/Root/test1
Exception: System.IO.FileLoadException
Message: Could not load file or assembly 'System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.
StackTrace: at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Activator.CreateInstance(String assemblyName, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, Evidence securityInfo, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.AppDomain.CreateInstance(String assemblyName, String typeName)
at System.Web.Hosting.ApplicationManager.CreateAppDom ainWithHostingEnvironment(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
at System.Web.Hosting.ApplicationManager.CreateAppDom ainWithHostingEnvironmentAndReportErrors(String appId, IApplicationHost appHost, HostingEnvironmentParameters hostingParameters)
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Why did it fail to initialise AppDomain and what is LM/W3SVC/1/Root/?
I then decided to open the project in Visual Web Developer 2005 Express Edition.
File > Open Project > test1
The data connection icons had red crosses through them and an error message to this effect was presented:
Error connecting to server, may be because SQL server doesn't like remote connections.
I thought this meant it didn't like my virtual directory in IIS so I started again. This time I copied the contents of
Chapter 01 - Online Diary folder straight to a new folder c:\inetpub\wwwroot\test2
I then pointed my browser to
http://localhost/test2/SignOn.aspx
I then get a different error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 7: <system.web>
Line 8:
Line 9: <roleManager enabled="true" />
Line 10: <authentication mode="Forms"/>
Line 11: <compilation debug="true"/></system.web>
Source File: c:\inetpub\wwwroot\test2\web.config Line: 9
Now, what does it mean "This error can be caused by a virtual directory not being configured as an application in IIS."???
Do I have to tell IIS that a folder is an application now?
I'm not sure what I've done wrong but previously when working with older ASP projects (not .Net) all I did was copy the folder into wwwroot and point my browser to localhost and it worked.
Any ideas would be much appreciated from anyone.
Thanks very much
Lindsay