Install Server.MapPath giving current directory

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
DavidR63
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Wed Aug 20, 2008 4:06 pm

Install Server.MapPath giving current directory

Post by DavidR63 » Mon Dec 22, 2008 11:27 am

I am trying to install AC7.0 on my web host. I am going to the install directory and I am getting the error below. When looking at the code I see it's getting the path using Server.MapPath("~/App_Data/PERMTEST.TXT"). On my dev box (internal) this has worked fine returning the correct website root. But on the host it's giving the current directory (Install) as the root. I know I am missing something, is there a configuration change I may need to make?? I would have called support but it took a very, very long time to get the web host company ready for this (whole other story). I have changed some names for privacy.

Installion Error
You do not appear to have the correct permissions to install. The application must have the ability to write files to your installation folder. Make sure the user has MODIFY access to the install path.

Windows User: MACHINE\ASPNET
Install Path: C:\websites\company\ablecommerce\Install\

The exception was:

Could not find a part of the path 'C:\websites\company\ablecommerce\Install\App_Data\PERMTEST.TXT'.
Last edited by DavidR63 on Mon Dec 22, 2008 12:53 pm, edited 1 time in total.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Install Server.MapPath giving current directory

Post by mazhar » Mon Dec 22, 2008 12:45 pm

Make sure that App_Data folder is not read only.

DavidR63
Ensign (ENS)
Ensign (ENS)
Posts: 5
Joined: Wed Aug 20, 2008 4:06 pm

Re: Install Server.MapPath giving current directory

Post by DavidR63 » Mon Dec 22, 2008 12:52 pm

That was my initial thought, but look at the error closely. Notice that it's looking for the App_Data folder under 'Install', it should be looking for App_Data under the ablecommerce folder. For some reason the Server.MapPath("~/App_Data/PERMTEST.TXT") is returning a relative path with 'Install' instead of 'ablecommerce' as the root for the site. The error also says that it cannot find part of that path, which makes sense since App_Data is in the root not Install. My dev box does not do this so something must be mis-configured, but what I don't know.

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Install Server.MapPath giving current directory

Post by mazhar » Wed Dec 24, 2008 6:42 am

One thing could be to make sure that your virtual directory maps to ablecommerce folder not to ablecommerce/install folder. It seems like it is taking ablecommerce/install as application where as it should be ablecommerce/

Post Reply