473,386 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Path Problems

I'm kind of new to all of this Web app development and have developed an
ASP.NET Web application under the default c:\inetpub\wwwroot\myApp.

I just went to move it to a hosted site and I'm having all sorts of trouble
following from the fact that the root in my development is actually *under*
the Default Web Site's root; whereas the root of the app in the hosted
environment is just the root, itself.

While I can go and recode the app so that it works in the hosted
environment, then it will break in my development machine.

What to do? I'm sure I'm not the first person to encounter this scenario -
what do you experts do to have root-relative paths match up between
development and production?

Thanks.

Nov 19 '05 #1
5 1279
WJ

"Jordan S" <A@B.COM> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
I'm kind of new to all of this Web app development and have developed an
ASP.NET Web application under the default c:\inetpub\wwwroot\myApp.

I just went to move it to a hosted site and I'm having all sorts of
trouble following from the fact that the root in my development is
actually *under* the Default Web Site's root;
Your applications do not need to be under the default c:\inetpub\wwwroot.
You can use the IIS/MMC to redirect your site to any folder within your box
at will. I am using Windows IIS since Windows NT 4.0 and now Server 2003
Standard and I have my own folder unless you use other webservers to host
your app.
While I can go and recode the app so that it works in the hosted
environment, then it will break in my development machine.

Never need to do this. Just code it and test your app in your Windows Xp PC
(as an example), once done, deploy it by doing the following:
What to do?


Just copy the needed files to the host where your application is pointed to.
Tell your web server what is the default page (ie. Default.Aspx or
..html...).

John
Nov 19 '05 #2
Thanks - so just to clarify, I think I'll be fine if I do the following:
1. Create any old folder I want (e.g., C:\MyWebApp)
2. In IIS, make it a Web application (with C:\MyWebApp as the root).
3. Move all of my application files and folders into it
4. Fix all the path-specific logic throughout my app.

Is this something you more experienced developers would do to fix my app? Is
there an easier/better way?

Thanks.

"WJ" <Jo*******@HotMail.Com> wrote in message
news:Ov**************@TK2MSFTNGP11.phx.gbl...

"Jordan S" <A@B.COM> wrote in message
news:e0**************@TK2MSFTNGP10.phx.gbl...
I'm kind of new to all of this Web app development and have developed an
ASP.NET Web application under the default c:\inetpub\wwwroot\myApp.

I just went to move it to a hosted site and I'm having all sorts of
trouble following from the fact that the root in my development is
actually *under* the Default Web Site's root;


Your applications do not need to be under the default c:\inetpub\wwwroot.
You can use the IIS/MMC to redirect your site to any folder within your
box at will. I am using Windows IIS since Windows NT 4.0 and now Server
2003 Standard and I have my own folder unless you use other webservers to
host your app.
While I can go and recode the app so that it works in the hosted
environment, then it will break in my development machine.


Never need to do this. Just code it and test your app in your Windows Xp
PC (as an example), once done, deploy it by doing the following:
What to do?


Just copy the needed files to the host where your application is pointed
to. Tell your web server what is the default page (ie. Default.Aspx or
.html...).

John

Nov 19 '05 #3
Don't hardcode paths into your application. Make everything relative and use
Server.MapPath when you need physical locations.
Nov 19 '05 #4
WJ
"Jordan S" <A@B.COM> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
Thanks - so just to clarify, I think I'll be fine if I do the following:
1. Create any old folder I want (e.g., C:\MyWebApp)
2. In IIS, make it a Web application (with C:\MyWebApp as the root).
3. Move all of my application files and folders into it
On top of that, give appropriate access privilege to the web account that
runs the web site (not web server). Example: If you have a folder that
accepts user's uploaded files, then make sure to grant write access to the
appropriate account for that folder.
4. Fix all the path-specific logic throughout my app.
Sound like you are hard coding stuffs. If so, yes, clean them up, do not
hard code things such as "c:\sss\somthing.aspx". Example: If you want to
invoke Page2.aspx from a, say Default.aspx, then in Default.aspx, just say:
Response.Redirect("Page2.aspx");
Is this something you more experienced developers would do to fix my app?
Is there an easier/better way?


You may want to buy a good book about IIS, it is good to know inside out
although you need not to. This is the function of a web admin. not
developer.

John

Nov 19 '05 #5
Thank you very much.
I'm not hard coding anything from the root (nothing like
C:\SomeFolder\SomeOtherFolder\SomeFile.aspx). Rather I programmatically
determine the current application's root:
string m_appRootFolder =
System.Web.HttpContext.Current.Request.Application Path.ToString();
and then refer to folders under the root.

The problem I had was one of really understanding where my application root
was and the associated issues resulting from using the default XP/Pro
C:\inetpub\wwwroot\MyApp setup created by VS.NET. Everything's cool when the
app exists under the current Web site's root - but the production server
uses the root, itself. When I started this project I didn't think much about
it. Now I have to (simple, but important).


"WJ" <Jo*******@HotMail.Com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
"Jordan S" <A@B.COM> wrote in message
news:eT**************@TK2MSFTNGP12.phx.gbl...
Thanks - so just to clarify, I think I'll be fine if I do the following:
1. Create any old folder I want (e.g., C:\MyWebApp)
2. In IIS, make it a Web application (with C:\MyWebApp as the root).
3. Move all of my application files and folders into it


On top of that, give appropriate access privilege to the web account that
runs the web site (not web server). Example: If you have a folder that
accepts user's uploaded files, then make sure to grant write access to the
appropriate account for that folder.
4. Fix all the path-specific logic throughout my app.

Sound like you are hard coding stuffs. If so, yes, clean them up, do not
hard code things such as "c:\sss\somthing.aspx". Example: If you want to
invoke Page2.aspx from a, say Default.aspx, then in Default.aspx, just
say: Response.Redirect("Page2.aspx");
Is this something you more experienced developers would do to fix my app?
Is there an easier/better way?


You may want to buy a good book about IIS, it is good to know inside out
although you need not to. This is the function of a web admin. not
developer.

John

Nov 19 '05 #6

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

Similar topics

31
by: John Roth | last post by:
I'm adding a thread for comments on Gerrit Holl's pre-pep, which can be found here: http://tinyurl.com/2578q Frankly, I like the idea. It's about time that all of the file and directory stuff...
5
by: Peter Stojkovic | last post by:
I have the following problem: I have a solution in path C:\AAA\CustomerA Now I have a second project: Then I copy everyThing to C:\AAA\CustomerB Bit inside the new project everything is...
34
by: Reinhold Birkenfeld | last post by:
Hi, the arguments in the previous thread were convincing enough, so I made the Path class inherit from str/unicode again. It still can be found in CVS:...
12
by: Xah Lee | last post by:
Python Doc Problem Example Quote from: http://docs.python.org/lib/module-os.path.html ---------- split( path) Split the pathname path into a pair, (head, tail) where tail is the last...
2
by: njr | last post by:
Having copied a number of folders from my development PC (XP) to a development server (W2003) and installed them under wwwroot (and created applications in IIS) I have problems when I include the...
5
by: Mike Krell | last post by:
I'm running into problems trying to override __str__ on the path class from Jason Orendorff's path module (http://www.jorendorff.com/articles/python/path/src/path.py). My first attempt to do...
4
by: John Smith | last post by:
Hello, I'm not sure if these are the appropriate forums for my question since it is closer to about Visual Studio 2005 than it is about .NET framework. So please pardon me and direct me to a...
34
by: Ben Sizer | last post by:
I've installed several different versions of Python across several different versions of MS Windows, and not a single time was the Python directory or the Scripts subdirectory added to the PATH...
0
by: Jacob Davis | last post by:
On Apr 3, 2008, at 10:54 AM, Trent Mick wrote: Thanks, that seems to have worked. I added "/usr/local/bin" to the PATH in the preferences Environment panel in Komodo. Then in preferences I...
34
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.