Monday, September 8, 2008

An undocumented Error ASP.NET "Arguments to MakeRelative must be root-relative"

I've been coming accross this error in one of my applications which use EpiServer and custom Page base class... it driving me banana, anyone came accross something like this?


Server Error in '/XXX.Web' Application.

Arguments to MakeRelative must be root-relative

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Arguments to MakeRelative must be root-relative

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[ArgumentException: Arguments to MakeRelative must be root-relative]    EPiServer.UrlBuilder.MakeRelative(String fromBase, String path) +417    EPiServer.UrlBuilder.Rebase(UrlBuilder fromBaseUrl, UrlBuilder toBaseUrl, RebaseKind kind) +553    EPiServer.Web.FriendlyHtmlRewriteToExternal.HtmlRewriteUrl(UrlBuilder internalUrl, UrlBuilder externalUrl, UrlBuilder url, Encoding encoding, Object& internalObject) +139    EPiServer.Web.FriendlyHtmlRewriteToExternal.rewritePipe_HtmlRewriteUrl(Object sender, HtmlRewriteEventArgs e) +304    EPiServer.Web.RewritePipe.OnHtmlRewriteUrl(HtmlRewriteEventArgs e) +19    EPiServer.Web.HtmlRewritePipe.WriteElement(MyHtmlRewriteEventArgs e, SgmlReader reader, TextWriter writer) +404    EPiServer.Web.HtmlRewritePipe.RewriteToEnd(TextReader reader, TextWriter writer) +2063    EPiServer.Web.HtmlRewriteStream.Close() +165    System.Web.HttpWriter.Filter(Boolean finalFiltering) +69    System.Web.HttpResponse.FilterOutput() +82    System.Web.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +47    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 


Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

1 comment :

WeSam Abdallah said...

after solving this issue, I thought I should share it with the rest

I had the following inside of a usercontrol in the Asp.Net application

< link src= "~#/siteAppPath/css" type="text/css" />

and that "#" alone caused an error that cost me a few hours to trace, considering the stack trace in this case is useless