Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Isolated Development model problems

Reply
Thread Tools

Isolated Development model problems

 
 
=?Utf-8?B?Sm9obiBUYWNrZQ==?=
Guest
Posts: n/a
 
      03-01-2004
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


 
Reply With Quote
 
 
 
 
Kevin Spencer
Guest
Posts: n/a
 
      03-01-2004
Use absolute URLs?

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

"John Tacke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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?
>
>



 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9obiBUYWNrZQ==?=
Guest
Posts: n/a
 
      03-01-2004
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.
 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      03-01-2004
"John Tacke" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Isolated Development on IIS 5.1 & 6.0 Wm. Scott Miller ASP .Net 3 03-18-2006 12:09 PM
Setting up an Isolated .NET Team Environment =?Utf-8?B?UmFscGg=?= ASP .Net 2 04-08-2005 02:17 PM
Article: What is Isolated Storage ? (.Net FrameWork Tools Series) Namratha Shah \(Nasha\) ASP .Net 0 11-17-2004 12:39 AM
Vss and VS.NET integration in Non-Isolated Development mode =?Utf-8?B?R2Fs?= ASP .Net 0 06-17-2004 08:15 AM
Install AD, DNS, DHCP on an isolated stand alone pc? Javier GP MCSE 5 09-30-2003 12:42 AM



Advertisments