Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Failed to map the path System.Web.HttpException

Reply
Thread Tools

Failed to map the path System.Web.HttpException

 
 
Adrian Tosca
Guest
Posts: n/a
 
      04-20-2005
Hi All,

I hope you can help me with this.
I am getting a "Failed to map the path
'/avionics/X_T_c101p02_k0opy2zv5r4ebl45jmdrr1mv_mainArea.ascx '"
System.Web.HttpException when trying to execute the code below.

string test = Server.MapPath("/avionics/" + mainAreaTemplate);
where mainAreaTemplate contains
'/avionics/X_T_c101p02_k0opy2zv5r4ebl45jmdrr1mv_mainArea.ascx '

What is strange is that the exception appears at the 3'rd request. The
first 2 requests the code execute ok (tested with breakpoints to be sure
of this).

I also tried with other paths and is the same situation (eg:
Server.MapPath("ab/ab.txt"). It works a couple of times and then it
crashes. It is strange that the number of working times is the same each
time so it is not an random error.

The only way it seems to work is within a page in the application root
that makes Server.MapPath("ab.txt") - with no directory in the path.
This is indeed even more strange.

I am actually trying to make a LoadControl(path) and it seems that
LoadControl execute internally a MapPath. From this I come to my
example. So there is a problem with MapPath no with LoadControl.

Note that there is no other thread that runs in the application or other
similar thing (I read on forums that this can be an issue).

You can find below the full exception stack.

If you find any idea please help me
Adrian


Please find below the full exception stack:
[HttpException (0x80004005): Failed to map the path
'/avionics/X_T_c101p02_ug3uus45sog14c45qaholh55_mainArea.ascx '.]
System.Web.Hosting.ISAPIWorkerRequest.MapPathSlowU singIISCore(String
path) +303
System.Web.Hosting.ISAPIWorkerRequest.MapPath(Stri ng path) +419
System.Web.HttpRequest.MapPath(String virtualPath, String
baseVirtualDir, Boolean allowCrossAppMapping)
System.Web.HttpRequest.MapPath(String virtualPath)
System.Web.HttpServerUtility.MapPath(String path)
Avionics.Web.CourseView.CoursePage.LoadDynamicCont rols() in
d:\proiecte\avionics\solution\webui\courseview\eng ine\ui\default.aspx.cs:123
Avionics.Web.CourseView.CoursePage.Course_PageChan ge(Object sender,
PageEventArgs e) in
d:\proiecte\avionics\solution\webui\courseview\eng ine\ui\default.aspx.cs:171
Avionics.Business.PageChangeEventHandler.Invoke(Ob ject sender,
PageEventArgs e) +0
Avionics.Business.Course.OnPageChange(PageEventArg s e) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Cours e.cs:45
Avionics.Business.Course.InternalOnPageChange(Page EventArgs e) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Cours e.cs:208
Avionics.Business.Course.Chapter_PageChange(Object sender,
PageEventArgs e) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Cours e.cs:248
Avionics.Business.Chapter.OnPageChange(PageEventAr gs e) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Chapt er.cs:68
Avionics.Business.Chapter.InternalOnPageChange(Pag eEventArgs e) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Chapt er.cs:62
Avionics.Business.Chapter.set_PageIndex(Int32 value) in
D:\Proiecte\Avionics\Solution\BusinessFacade\Chapt er.cs:158
Avionics.Business.Course.NextPage() in
D:\Proiecte\Avionics\Solution\BusinessFacade\Cours e.cs:164

Avionics.Web.CourseView.CoursePage.CoursePage_Chan geActivePage(Object
sender, CommandEventArgs e) in
d:\proiecte\avionics\solution\webui\courseview\eng ine\ui\default.aspx.cs:203

Avionics.Web.Controls.Footer.OnNavigationBarItemCl ick(CommandEventArgs
e) in d:\proiecte\avionics\solution\webui\footercontrol. ascx.cs:88
Avionics.Web.Controls.Footer.InternalOnNavigationB arItemClick(Object
sender, CommandEventArgs e) in
d:\proiecte\avionics\solution\webui\footercontrol. ascx.cs:110
Avionics.Web.Controls.Footer.navMenu_ItemCommand(O bject source,
DataListCommandEventArgs e) in
d:\proiecte\avionics\solution\webui\footercontrol. ascx.cs:143

System.Web.UI.WebControls.DataList.OnItemCommand(D ataListCommandEventArgs e)
System.Web.UI.WebControls.DataList.OnBubbleEvent(O bject source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.DataListItem.OnBubbleEve nt(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
System.Web.UI.WebControls.ImageButton.OnCommand(Co mmandEventArgs e)

System.Web.UI.WebControls.ImageButton.System.Web.U I.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData)
System.Web.UI.Page.ProcessRequestMain()


 
Reply With Quote
 
 
 
 
Adrian Tosca
Guest
Posts: n/a
 
      04-20-2005
Some more info:

It seems that the problem appear only if the MapPath is executed on an
event that originated from a user control. If the same code is executed
elsewere (like for example on page pre render event) there is no
exception rised.

I used this info as a workaround (set a bool to true on the event and
execute my code on pre render).

Adrian
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP.NET 2.0: "hello world" page fails with "Failed to map the path =?Utf-8?B?cmFuZHkgY29sbGlucw==?= ASP .Net 6 04-13-2011 01:50 PM
Failed to map the path '/App_GlobalResources/' =?Utf-8?B?QWRhbQ==?= ASP .Net 13 11-14-2005 01:26 AM
ASP.NET app initialization problem (Failed to map the path) =?Utf-8?B?QW5kZXJzIEJvcm5ob2xt?= ASP .Net 2 10-17-2005 02:44 PM
Server.MapPath() croaking with "failed to map path", but path is legal awbacker@gmail.com ASP .Net 0 05-12-2005 10:50 PM
"Failed to map the path" - error on first visit Jonas Auken ASP .Net 1 10-12-2004 02:14 AM



Advertisments