Isolated Development model problems

Discussion in 'ASP .Net' started by =?Utf-8?B?Sm9obiBUYWNrZQ==?=, Mar 1, 2004.

  1. When developing ASP.NET apps using Microsoft's recommended isolated model (develop on your local iis), there are deployement reference problems because the local website is generally one level deeper than the production website.

    For example, the local website (running XP Pro) is: http://localhost/webapp. Images are kept in the images subfolder. Because IIS does not recognize subwebs as roots, the local means of refering to an image is /webapp/images/image.jpg. Using /images/image.jpg does not work for the above reason

    So when the site is migrated to http://www.webapp.com, the image reference is no longer valid, and needs to be /images/image.jpg, NOT /webapp/images/image.jpg

    The only solution I can come up with is to use a server OS on our development machines so we can have multiple web sites. But I really don't want to do this

    Is there a better solution
     
    =?Utf-8?B?Sm9obiBUYWNrZQ==?=, Mar 1, 2004
    #1
    1. Advertising

  2. Use absolute URLs?

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "John Tacke" <> wrote in message
    news:...
    > When developing ASP.NET apps using Microsoft's recommended isolated model

    (develop on your local iis), there are deployement reference problems
    because the local website is generally one level deeper than the production
    website.
    >
    > For example, the local website (running XP Pro) is:

    http://localhost/webapp. Images are kept in the images subfolder. Because
    IIS does not recognize subwebs as roots, the local means of refering to an
    image is /webapp/images/image.jpg. Using /images/image.jpg does not work for
    the above reason.
    >
    > So when the site is migrated to http://www.webapp.com, the image reference

    is no longer valid, and needs to be /images/image.jpg, NOT
    /webapp/images/image.jpg.
    >
    > The only solution I can come up with is to use a server OS on our

    development machines so we can have multiple web sites. But I really don't
    want to do this.
    >
    > Is there a better solution?
    >
    >
     
    Kevin Spencer, Mar 1, 2004
    #2
    1. Advertising

  3. Absolute references won't work because there will be one or even two development and stage servers (http://stage.webapp.com) before getting to production, plus hard-coding the absolute URL invites a big maintenance problem if the URL changes.
     
    =?Utf-8?B?Sm9obiBUYWNrZQ==?=, Mar 1, 2004
    #3
  4. "John Tacke" <> wrote in message
    news:...
    > When developing ASP.NET apps using Microsoft's recommended isolated model

    (develop on your local iis), there are deployement reference problems
    because the local website is generally one level deeper than the production
    website.
    >
    > For example, the local website (running XP Pro) is:

    http://localhost/webapp. Images are kept in the images subfolder. Because
    IIS does not recognize subwebs as roots, the local means of refering to an
    image is /webapp/images/image.jpg. Using /images/image.jpg does not work for
    the above reason.
    >
    > So when the site is migrated to http://www.webapp.com, the image reference

    is no longer valid, and needs to be /images/image.jpg, NOT
    /webapp/images/image.jpg.
    >
    > The only solution I can come up with is to use a server OS on our

    development machines so we can have multiple web sites. But I really don't
    want to do this.
    >
    > Is there a better solution?


    Use site-relative URLs. ~/images/separator.gif will refer to
    http://localhost/webapp/images/separator.gif locally, or
    http://www.webapp.com/images/separator.gif in production.

    The only catch is that only ASP.NET understands these URLs. It translates
    them into the appropriate "real" URL when your page is being rendered as
    HTML. But ASP.NET can only see controls marked "runat=server". This means
    that you need to do things like:

    <img runat="server" src="~/images/separator.gif" >

    --
    John Saunders
    John.Saunders at SurfControl.com
     
    John Saunders, Mar 1, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Namratha Shah \(Nasha\)
    Replies:
    0
    Views:
    9,050
    Namratha Shah \(Nasha\)
    Nov 17, 2004
  2. =?Utf-8?B?R2Fs?=
    Replies:
    0
    Views:
    392
    =?Utf-8?B?R2Fs?=
    Jun 17, 2004
  3. =?Utf-8?B?UmFscGg=?=

    Setting up an Isolated .NET Team Environment

    =?Utf-8?B?UmFscGg=?=, Mar 28, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    417
    =?Utf-8?B?UmFscGg=?=
    Apr 8, 2005
  4. Wm. Scott Miller

    Isolated Development on IIS 5.1 & 6.0

    Wm. Scott Miller, Mar 17, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,822
    Erik Funkenbusch
    Mar 18, 2006
  5. Replies:
    0
    Views:
    358
Loading...

Share This Page