Converting ASP site to .NET

engwar1_at_yahoo.com
Date: 03/10/05


Date: 9 Mar 2005 16:03:59 -0800

I'm a .NET newbie and am beginning the process of converting an
existing personal website to .NET from classic ASP.

I'm assuming I want my aspx files in the root of my site in the same
place as my asp files. In this way when I eventually get switched over
to all aspx files my URLs will not have an extra directory name, only
the extensions will change.

I've got things set up and working on my dev box but have some
questions.

Previously I had my server set up so that the root folder of my web was
a subdirectory of wwwroot (wwwroot\myAspSite) and in IIS set the home
directory of my default website to the subdirectory "myAspSite" so that
http://localhost loads my website. Standard stuff.

When I create a new project in VS it wants me to create a new
subdirectory of "myAspSite". Since what I really wanted was my new
project to be "localhost" this isn't what I intended.

So I changed IIS to use "wwwroot" as my home directory and using VS
created my new project as "myNetSite" under that. Then I moved my old
ASP files to this new directory.

But then I had a problem in that the paths I used were absolute <img
src="/images/foo.jpg"> and I now will have to change them to relative
paths for them to work <img src="..images/foo.jpg"> (same as all my
internal hyperlinks.)

This is because "myNetSite" isn't the root anymore but is a
subdirectory of a root. And my code uses <img src="/images/... to find
graphics etc.

I realized that instead of making these tedious code changes I can just
change IIS to use "myNetSite" as the home directory. The problem here
is that when I launch my app from within VS debug-->Start Without
Debugging that I get an error because it's requesting
http://localhost/myNetSite instead of just http://localhost.

While I can hit my new .aspx pages successfully by typing the correct
address into the browser this isn't a good solution because I can't
debug my pages from within VS.

Should I just replace my absolute paths with relative paths? I prefer
absolute paths and would rather avoid this. Or is there a way to tell
VS to use "localhost" instead of "localhost/myNetSite" when it's
looking for my application? Or some other way to set this up that I
haven't thought of?

Also, when my site is running on the production server my files are all
in "wwwroot" directly so my ISP somehow must be able to make that
directory be the root of my .NET application.

Can anyone clarify or explain this?

Thanks.



Relevant Pages

  • Re: how to protect mdb
    ... I just found out they keep everything in the root of the website. ... I am using asp to access this database. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Could Not Load Assembly
    ... it's better to keep the root site's ASP.NET version mapping the same ... Can you create a new website for testing? ... Microsoft Online Support ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Forcing ASP.NET 1.1 isnt working
    ... Since the home page was asp (unmanaged code), ... the website require access to the 2.0 framework directory. ... (and without reconfiguring any existing apps to run under ASP.NET 2.0). ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Bug when IIS mapped to root of drive
    ... but count on unpredictability. ... But please do not fill up your root with junk! ... > If I map the Default Website in IIS to D:\wwwroot then everything is OK. ...
    (microsoft.public.vstudio.general)
  • Re: Manually Configure site for ASP .NET 2 - Revisited
    ... but with Windows XP x64 Edition. ... Configuring web site http//localhost/DotNetNuke to ASP .NET 2.0 failed. ... devices", I have created a website, but as soon as I carry out the last ...
    (microsoft.public.dotnet.framework.aspnet)