Re: Converting ASP site to .NET

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Nick Malik [Microsoft] (nickmalik_at_hotmail.nospam.com)
Date: 03/10/05


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.
> 


Relevant Pages

  • Re: Dependency tracking application
    ... this with a regular dimension or parent-child ... required to actively Use the app. ... An app cannot exist sans a server. ... Baring that, I think the server would be at the root, and the apps ...
    (microsoft.public.sqlserver.olap)
  • Re: su, sudo, ssh, permissions question
    ... > The app does hw and system file access, so needs root priviledge. ... > Remote login is provided using ssh for admin. ... > allows me to autologin as root (if root has no pwd), ...
    (alt.os.linux.redhat)
  • Re: Python Tkinter Simple Qn
    ... I switch to switch the image background (which i used Tkinter.Label ... global root ... The variable image2 is not known in this context, ... you create image2 as a local variable in function app. ...
    (comp.lang.python)
  • Re: Password problems
    ... There is no root account on this box. ... will with the new root passwd, and if you can su to root ... Use a gtk app that asks for the root ...
    (Debian-User)
  • RE: VFP8 forms do not print
    ... Do you have the same relative paths on the machine where the problem occurs ... Keep an eye on the product lifecycle for Visual FoxPro here: ... Other forms from the same app. ...
    (microsoft.public.fox.vfp.forms)