Re: Converting ASP site to .NET
From: Nick Malik [Microsoft] (nickmalik_at_hotmail.nospam.com)
Date: 03/10/05
- Next message: Patrice: "Re: VB vs C#"
- Previous message: Nick Malik [Microsoft]: "Re: Protecting Assembly against disassembling..."
- In reply to: engwar1_at_yahoo.com: "Converting ASP site to .NET"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 10 Mar 2005 08:10:51 -0800
How you develop and how you deploy are two different things.
a) ALWAYS use relative paths. Otherwise, you limit how and where your app
is deployed. You also minimize mistakes.
b) Let VS create the virtual directory for you
(http://localhost/myapp/default.aspx) and use it.
c) When you deploy, the ISP can easily set up the virtual directory to point
directly to your app.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
<engwar1@yahoo.com> wrote in message
news:1110413039.129775.135810@l41g2000cwc.googlegroups.com...
> 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.
>
- Next message: Patrice: "Re: VB vs C#"
- Previous message: Nick Malik [Microsoft]: "Re: Protecting Assembly against disassembling..."
- In reply to: engwar1_at_yahoo.com: "Converting ASP site to .NET"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|