我有一个.net应用程序,我刚刚在visual studio 2010中打开了它,当它要求我启动时,它转换到了4.0。我去尝试建立这个网站,我得到了这个错误:
Failed to map the path '/'.
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.
[InvalidOperationException: Failed to map the path '/'.]
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8804446
System.Web.Hosting.HostingEnvironment.MapPathInternal(VirtualPath virtualPath) +42
System.Web.VirtualPath.MapPathInternal() +4
System.Web.HttpRequest.MapPath(VirtualPath virtualPath, VirtualPath baseVirtualDir, Boolean allowCrossAppMapping) +107
System.Web.HttpRequest.MapPath(VirtualPath virtualPath) +37
System.Web.HttpServerUtility.MapPath(String path) +99
NU.WorkManagement.Lookup.Lookups..ctor() +82
NU.WorkManagement.Engine.GlobalModule.Init(HttpApplication application) +624
System.Web.HttpApplication.InitModulesCommon() +80
System.Web.HttpApplication.InitModules() +43
System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +828
System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +304
System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +327
我尝试了我找到的最流行的解决方案vis google (用~/替换和../,但没有任何...)
更新:
查找构造函数:
public Lookups()
{
_dirPath = System.Web.HttpContext.Current.Server.MapPath("/") + _xmlPath;
}
https://stackoverflow.com/questions/5513499
复制相似问题