473,503 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

urgent help needed, Server.MapPath() works differently on server than on development machine

Hi,

BACKGROUND:
Win2K Server SP4, ASP.NET 1.1
Win2K Pro SP4, ASP.NET 1.1
I have a wrapper class around all the asp objects.

Website physical directory structure (phoney names)
Server:
C:\MySite
|_ _Settings
|_ Root
|_ Bin (contains the DLL)
|_ XSL

Development test machine
C:\TestSite
|_ _Settings
|_ Root
|_ Bin (contains the DLL)
|_ XSL

In both cases ParentPaths are enabled. In IIS the sites directory is set
to C:\MySite\Root and
C:\TestSite\Root respectively.

I read in the settings file from the _Settings directory; working out the
physical path with:

Directory.GetParent(Asp.Server.MapPath("/")).FullName & "\"

For some bizarre reason on the server this results in:
C:\MySite\Root\_Settings

....but correctly on the development machine:
C:\MySite\_Settings

I have tried saying:
Asp.Server.MapPath("~")
.... instead, again, this works on the development machine but not on the
server.

The only difference as far as I can see is that the server site has it's own
URL
where as the development machine has a virtual root.

This project is a port from a VB6/ASP app which worked fine with the same
code
as above.

I think for some weird reason when running on the server it is somehow
getting the
"Bin" directory hence why the above is returned on the server. But I have
tested
it on my development machine against the compiled DLL and it still works
even then.

Any ideas as to what is going on would be most appreciated.

Regards,
Peter Row


Nov 18 '05 #1
0 1201

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

Similar topics

7
3672
by: Elie Grouchko | last post by:
Hi I am running exactly the same ASP code on IIS 5.0 and IIS 6.0 I am calling Server.MapPath(), the parameter is a virtual path that includes a reference to a parent path...
0
1218
by: Peter Row | last post by:
Hi, BACKGROUND: Win2K Server SP4, ASP.NET 1.1 Win2K Pro SP4, ASP.NET 1.1 I have a wrapper class around all the asp objects. Website physical directory structure (phoney names) Server:...
3
2152
by: Microsoft Newsgroups | last post by:
Hi all, I'm having an interesting problem with my IE Webcontrols. I'm using the toolbar and when I test it in my browser using "http://localhost/mysite", it works fine. Incidentally, I have...
6
1493
by: Mike L. | last post by:
Hi, Pls, beware that I'm new to this :) I've developed several web appl, either with ASP or ASP.NET. All using SQL server as the back end. In my development environment, I have a single...
1
1940
by: Manish Songar via .NET 247 | last post by:
I am using asp.net. I am not storing image in sql server.I store all the image in one folder. I want to access image from that folder to my client machine. Images folder (\Orchid_Image) store in...
19
10159
by: Steve Franks | last post by:
I am using VS.NET 2005 beta 2. When I run my project locally using the default ASP.NET Development Web Server it runs using a root address like this: http://localhost:11243/testsite/ However...
16
2890
by: | last post by:
Hi all, I have a website running on beta 2.0 on server 2003 web sp1 and I keep getting the following error:- Error In:...
0
1256
by: Michael | last post by:
Hi I have a problem related to global.asax and the Server.Mappath-Method. I collect all unhandled errors in the Application_Error in Global.asax. According to the type of error I...
4
1241
by: slinky | last post by:
I've tried this week everything I can think of to get this code to work , can any kind soul take a look at my code and my what should be a simple task and help me out. I've looked in books,...
0
7202
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
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7330
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...
0
7460
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3154
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.