Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 8th, 2010, 03:53 PM
Authorized User
 
Join Date: Aug 2010
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default Chapter 18 - Deployment Problem

Hi Imar. I'm having an issue with deployment. IIS and ASP.NET 3.5 are installed and working (as far as I can tell), and I followed the instructions in the chapter for the file system security permissions. The website does load when I go to localhost in the browser, but it does so with no formatting whatsoever; All the text and links are present, but it's just plain text with no images or styles. And when I try to navigate to the Images folder in the browser (localhost/Images) the page loads but is completely blank. Same goes for localhost/Styles/Styles.css

Any help is much appreciated, as always.

-Chris
Reply With Quote
  #2 (permalink)  
Old October 9th, 2010, 03:21 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Looks like something is not configured right in IIS. Can you describe your setup? E.g. the physical folder structure, the files that the Styles and Images folder contain and so on? And which folder did you map in IIS? Did you change the settings for the Default Web Site? And what is the exact address you type in the browser? http://localhost/Styles including the http and so on? Also, when you look at the site in IIS, do you see these folders appear and do they contain the files you expect?

And did you apply the correct security settings to these folders?

Finally, what happens when you browse to an image directly, such as http://localhost/Images/Banner468x60.gif ?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old October 9th, 2010, 04:59 PM
Authorized User
 
Join Date: Aug 2010
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Hi there,

Looks like something is not configured right in IIS. Can you describe your setup? E.g. the physical folder structure, the files that the Styles and Images folder contain and so on?
Here is my file structure. It's very similar to what you have in the book up through chapter 13.

C:
-BegASPNET
--Release
---About
----AboutUs.aspx/aspx.vb
----Contact.aspx/.aspx.vb
----Default.aspx/.aspx.vb
---App_Browsers
----BrowserFile.browser
---App_Code
----BasePage.vb
----Calculator.vb
----Direction.vb
----NameService.vb
----PlanetWrox.dbml/.layout/.designer.vb
---App_Data
----ContactForm.tx
----PlanetWrox.mdf
----PlanetWrox_log.ldf
---App_Themes
----DarkGrey
-----Images
------BodyBackground.jpg
------Header.gif
------PleaseWait.gif
-----DarkGrey.css
----Monochrome
-----Images
------Header.jpg
------MenuBackground.jpg
------PleaseWait.gif
------Sidebar.jpg
-----Button.skin
-----Monochrome.css
---Controls
----Banner.ascx/.ascx.vb
----ContactForm.ascx/.ascx.vb
---GigPics
----various images
---Images
----Banner120x240.gif
----Banner468x60.gif
---Management
----AddEditReviews.aspx/.aspx.vb
----Default.aspx/.aspx.vb
----Genres.aspx/.aspx.vb
----Reviews.aspx/.aspx.vb
----web.config
---MasterPages
----ManagementMaster.master/.master.vb
----MasterPage.master/.master.vb
---PhotoAlbums
----Default.aspx/.aspx.vb
---Reviews
----All.aspx/.aspx.vb
----AllByGenre.aspx/.aspx.vb
----Default.aspx/.aspx.vb
---Styles
----Styles.css
----TestStyleSheet.css
---WebServices
----NameService.asmx
---AboutUs.aspx/.aspx.vb
---Default.aspx/.aspx.vb
---Login.aspx/.aspx.vb
---ManagePhotoAlbum.aspx/.aspx.vb
---NewPhotoAlbum.aspx/.aspx.vb
---web.config
---web.sitemap


Quote:
Originally Posted by Imar View Post
And which folder did you map in IIS?
C:\BegASPNET\Release

Quote:
Originally Posted by Imar View Post
Did you change the settings for the Default Web Site?
Yes, I changed the physical path to C:\BegASPNET\Release and put default.aspx at the top of the Default Documents list.

Quote:
Originally Posted by Imar View Post
And what is the exact address you type in the browser? http://localhost/Styles including the http and so on?
I've done it with http://localhost, localhost, my IP address, and http://myIPaddress. They all load the site, just with the same problem.

Quote:
Originally Posted by Imar View Post
Also, when you look at the site in IIS, do you see these folders appear and do they contain the files you expect?
Wait a minute... the folders are there but they do not show the files! I did not realize this until just now.

Quote:
Originally Posted by Imar View Post
And did you apply the correct security settings to these folders?
Yes, I believe I did.

Quote:
Originally Posted by Imar View Post
Finally, what happens when you browse to an image directly, such as http://localhost/Images/Banner468x60.gif ?
Completely blank page.

-Chris
Reply With Quote
  #4 (permalink)  
Old October 9th, 2010, 05:31 PM
Authorized User
 
Join Date: Aug 2010
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Actually upon closer inspection, IIS does show the files; I just had to click on "content view" to have them show up...

EDIT: Also, I don't know how relevant this is, but when I go to Basic Settings under Edit Site in IIS and click Test Settings, I get the following error:

"The server is configured to use pass-through authentication with a built-in account to access the specified physical path. However, IIS Manager cannot verify whether the built-in account has access. Make sure that the application pool identity has Read access to the physical path. If this server is joined to a domain, and the application pool identity is NetworkService or LocalSystem, verify that <domain>\<computer_name>$ has Read access to the physical path. Then test these settings again."

(Authentication succeeds, but Authorization shows this error)

Last edited by caiman; October 9th, 2010 at 07:28 PM..
Reply With Quote
  #5 (permalink)  
Old October 10th, 2010, 03:19 AM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
Finally, what happens when you browse to an image directly, such as http://localhost/Images/Banner468x60.gif ?

Completely blank page.
Did you install the "Static Content" item from the Common HTTP Features when installing / configuring IIS through the Programs and Features | Windows Features? (That is, when you're using a recent version of Windows running IIS 7.)

Quote:
The server is configured to use pass-through authentication with a built-in account to access the specified physical path
Did you enter a user name and password in IIS to access specific folders? If so, you shouldn't do that. You should determine and configure the account for IIS as explained in the book (e.g. Network Service, ASPNET or any of the other accounts depending on your configuration). Then IIS runs under that account provided it has access to the files on disk,. There's no need to assign a user name and password in IIS, other than the account used by the entire site (configured on the app pool in IIS 7 as explained in the book).
Which version of IIS and Windows are you using?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
caiman (October 10th, 2010)
  #6 (permalink)  
Old October 10th, 2010, 01:32 PM
Authorized User
 
Join Date: Aug 2010
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Did you enter a user name and password in IIS to access specific folders?
No, I sure didn't.

Quote:
Originally Posted by Imar View Post
Which version of IIS and Windows are you using?
IIS 6 on Windows Vista Home Premium

Quote:
Originally Posted by Imar View Post
Did you install the "Static Content" item from the Common HTTP Features when installing / configuring IIS through the Programs and Features | Windows Features? (That is, when you're using a recent version of Windows running IIS 7.)
No, this was not installed. I just now installed it and... it solved the problem! Fantastic! Thank you so much.

So why did this work? What does it mean to install static content?

-Chris
Reply With Quote
  #7 (permalink)  
Old October 10th, 2010, 02:31 PM
Imar's Avatar
Wrox Author
Points: 72,022, Level: 100
Points: 72,022, Level: 100 Points: 72,022, Level: 100 Points: 72,022, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,076
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
IIS 6 on Windows Vista Home Premium
Vista ships with IIS 7, so you're either not using Vista, or not IIS 6 ;-) I assume the latter is the case.

The Static Content module does what its name implies: it serves static content, such as HTML, CSS and image files that don't need to be processed by the ASP.NET pipe line. To minimize the attack vector, IIS is split up in components which you can install separately. If you never need to serve static content (can hardly think of a good reason why that would ever be the case; maybe in a pure web service scenario) you don't need to install that module. If a security vulnerability is discovered in that module, servers that don't have it installed are safe.

Normally, when you follow the book's instructions on installing IIS, this feature gets installed automatically.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #8 (permalink)  
Old October 10th, 2010, 03:14 PM
Authorized User
 
Join Date: Aug 2010
Posts: 19
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Imar View Post
Vista ships with IIS 7, so you're either not using Vista, or not IIS 6 ;-) I assume the latter is the case.
Ah yes, I think I was looking at the version of the IIS Manager, not IIS itself.

I'm not really sure how I missed the static content option during the IIS installation. Perhaps I need to practice my mouse clicking skills :)

Thank you so much for the help. I really appreciate it.

-Chris
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 18 code problem hennie7863 BOOK: Professional Microsoft SQL Server 2008 Integration Services ISBN: 978-0-470-24795-2 1 September 9th, 2010 03:33 PM
Chapter 18 rock1233 BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 November 14th, 2009 03:35 PM
Chapter 18 code compile problem warlock7 BOOK: Ivor Horton's Beginning Visual C++ 2005 8 January 3rd, 2008 10:04 AM
Chapter 18 - Struts rollopa JSP Basics 0 September 14th, 2003 03:23 PM



All times are GMT -4. The time now is 04:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.