KeyLimeTie Blog

ASP.NET 2.0 environment setup

By Brian Pautsch – 6/21/2006 5:14:44 AM. Posted to Thoughts.

I've seen a lot of people have problems getting their image, css and js paths setup correctly in ASP.NET 2.0. In 2.0, every site runs on its own port just off the localhost, but the "virtual directory" name is still in the path...so you can't force everything down to the root. If you do any type of URL Rewriting or use Master Pages in pages in different level subfolders, this is going to be an issue. Prefixing paths with '~/' works sometime, but not for all cases.

In 1.1, I would often set the webinfo file contents to point to http://localhost. Why not do the same in 2.0? To do so, open your web project Property Pages, click into the 'Start Options' area, select 'Use custom server' and enter in 'http://localhost'. This will set your environment up as if it were running on your server as a website. Only pain is changing the IIS default directory when working on another site...but that only takes a couple of seconds.

Comments

On 6/28/2006 JJ said:
Thanks! I was getting stuck on this too.

Leave a Comment

Name:
Email:
URL:
Comment:
Security Code:
Type Security Code:

Photos on Flickr

More Photos »

Search Blog


Get Email Updates

Like what you read here at KeyLimeTie? Sign up for our email list!

Subscribe