Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 26th, 2008, 09:26 AM
LF LF is offline
Registered User
 
Join Date: Jan 2008
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Online Diary - Server Application Unavailable

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

  #2 (permalink)  
Old January 26th, 2008, 09:34 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Lindsay,

Did you try running the application at the root of IIS?

1. Make sure you have the site's contents at C:\Inetpub\wwwroot\Diary

2. Open up IIS Manager and change the *default web site* (don't create a virtual directory) and point it C:\Inetpub\wwwroot\Diary

3. Browse to http://localhost

Alternatively, mark the Virtual Directory you created as an Application by clicking the Create button on the Home Directory tab.

The fact you're getting the other errors is probably because of security settings. IIS is not allowed to read files in your My Documents folder.

Refer to chapter 5 / CMS for more info about security settings.

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #3 (permalink)  
Old January 26th, 2008, 09:35 AM
Registered User
 
Join Date: Jan 2008
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

There can be basically two reasons.

1) You have not configured the virtual folder as application.

2) You are loading two framework viz .net 1.1 and .net 2.0 in the same application domain.

Solution:
For 1. Create virtual application.

For 2. Create a different application pool and name it .net 2.0. Use this application pool for .net 2.0 applications.


  #4 (permalink)  
Old January 26th, 2008, 11:25 AM
LF LF is offline
Registered User
 
Join Date: Jan 2008
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well it's 1:55am and the first bit works now!
Thanks guys for your extremely quick reply.

The problem was permissions. I didn't know that you had to click this "create" button.
That is:
IIS Manager > Right click on folder with site content > Application >Create
I then set the permissions to read and write for the whole folder

Now I have this problem:

Server Error in '/test2' Application.
--------------------------------------------------------------------------------

Failed to update database "C:\INETPUB\WWWROOT\TEST2\APP_DATA\ASPNETDB.MD F" because the database is read-only.

It's exciting because the error message is now different!

Why is my database read only? How does one set permissions for SQL Server to modify the database?

Thanks again
Lindsay

  #5 (permalink)  
Old January 26th, 2008, 11:34 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's not really read-only. It appears as such because the account is not allowed to alter the database file.

Look at page 162 - 164 of chapter 5 for instructions.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.
  #6 (permalink)  
Old January 28th, 2008, 03:22 AM
LF LF is offline
Registered User
 
Join Date: Jan 2008
Location: , , Australia.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much Imar.
Thanks to you, problem solved.

Lindsay

  #7 (permalink)  
Old January 28th, 2008, 05:29 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're welcome. Glad it's working now...

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server Application Unavailable td_ma ASP.NET 1.0 and 1.1 Basics 0 October 27th, 2008 03:15 AM
Application similar to Online Diary gsrai31 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 April 19th, 2008 08:41 AM
SERVER APPLICATION IS UNAVAILABLE msathyaprasad90 ASP.NET 1.0 and 1.1 Professional 4 June 24th, 2006 02:16 AM
Server Application Unavailable CraigJones ASP.NET 1.0 and 1.1 Basics 6 December 18th, 2003 11:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.