Please note: the article does not apply to Routing Assistant v1.8 and higher.
Routing Assistant gathers the routing details for web applications by employing both a static analysis engine and a lightweight ASP.NET runtime host. Due to the way the product uses this runtime host, under certain scenarios the Routing Assistant user interface may show an error message like the following one, instead of the familiar list of routes:
System.Web.HttpException (0x80004005): Server operation is not available in this context.
at System.Web.HttpServerUtility.MapPath(String path)
at Foo.Bar.Application_Start() in C:\Foo\Global.asax.cs:line 123
This happens because Routing Assistant tries to initialize the target web application without issuing a HTTP request, for security reasons. In order to support this scenario, you may want to check your application class (Global.asax) and see if its Application_Load() method uses the current HttpContext in some way. If possible, you should change this to avoid using the current HttpContext.
Both the HttpServerUtility.MapPath() and the related Server.MapPath() methods, for example, uses the current HttpContext under the covers. Calls to these methods can be safely replaced by a call to HostingEnvironment.MapPath(), as explained here.
Not only you will make your application more friendly to the Routing Assistant's eyes but you will also support some ASP.NET automation scenarios too.
Not what you are looking for?
Please don't hesitate to contact us if you have problems with any of our products or services; technical support is always free of charge, and requests made by registered clients will have higher priority.