MapPath strange error

Posted by Cristian Boariu on Stack Overflow See other posts from Stack Overflow or by Cristian Boariu
Published on 2010-05-29T09:07:49Z Indexed on 2010/05/29 9:12 UTC
Read the original article Hit count: 143

Filed under:
|

Hi,

I have the following code:

string path = "~/Others/Muzica/Demo/"+interpret+"_"+album+"/";
CMSUtils.CreateFolder(MapPath(path));

where CreateFolder method is like:

 public static void CreateFolder(string path)
{
    if (!System.IO.Directory.Exists(path))
    {
        System.IO.Directory.CreateDirectory(path);
    }
}

So i create that folder if it does not exists... All works great locally BUT i do not understand why, if i put it on the server it gives:

Failed to map the path '/gramma_prod/Others/Muzica/Demo/Vitamina C_De n-ai fi fost Tu /'.

at CMSUtils.CreateFolder(MapPath(path));

I have checked if: /gramma_prod/Others/Muzica/Demo/ exists on the server and of course it exists...

Does anybody see the problem?

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET