472,338 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,338 software developers and data experts.

Isolated Development model problems

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
Nov 18 '05 #1
3 1226
Use absolute URLs?

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

"John Tacke" <jo***@frontlinesolutions.com> wrote in message
news:17**********************************@microsof t.com...
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?

Nov 18 '05 #2
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.
Nov 18 '05 #3
"John Tacke" <jo***@frontlinesolutions.com> wrote in message
news:17**********************************@microsof t.com...
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
Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jared Thirsk | last post by:
== Introduction to DAF == I am interested in the next generation of approaches to software development. Over the last decades, there has been...
70
by: KingIshu | last post by:
Hi All, I am developing an object oriented OS code-named "ikbocs". 1) What are the pros and cons of the following languages interms of...
0
by: Namratha Shah \(Nasha\) | last post by:
Hey Group, After a long week end I am back again. Its nice and refreshing after a short vacation so lets get started with .NET once again. ...
10
by: Shawn | last post by:
Hi, For a few years, I have been developing each of my clients websites using a seperate web site (unique IP) to solve problems with relative...
2
by: Ralph | last post by:
Hi, I've done a bit of reading on setting up an Isolated .NET environment for each of my developers. We all run Windows XP Pro, IIS and have...
3
by: Wm. Scott Miller | last post by:
We have been looking at how to develop in a team environment where our servers are all Windows Server 2003 (IIS 6.0) and all our development...
4
by: Richard Levasseur | last post by:
(Forewarning, most of these problems and solutions come from being the only developer in a 1 server department with no budget, few resources,...
3
by: U.C. | last post by:
Hello, My client needs to collect data on a disconnected computer. I am hoping I could store data in Isolated Storage as XML files and expose...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: teenabhardwaj | last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.