all groups > visual studio .net general > october 2007 >
You're in the

visual studio .net general

group:

Re: (IIS6) Server.MapPath(strPath) - Bug 4 folders not under \inetpub\wwwroot?


Re: (IIS6) Server.MapPath(strPath) - Bug 4 folders not under \inetpub\wwwroot? Anthony Jones
10/31/2007 10:29:23 PM
visual studio .net general: [quoted text, click to view]

This is not a bug.

The '~' alias represents the HttpApplication root folder. The
Default.aspx is running in application which as the root ' /myapplication;.
Hence '~/myserveroutput' is equivalent to '/myapplication/myserveroutput'.

Once the ~ alias has been resolved the physical path can be resolved. Since
'myapplication' is a physical folder under c:\inetpub\wwwroot then the
calculated physical path is
'c:\inetpub\wwwroot\myapplication\myserveroutput'. There is no requirement
for this folder to actually exist.

Try server.mappath("/myserveroutput") instead.

--
Anthony Jones - MVP ASP/ASP.NET

AddThis Social Bookmark Button