Tengo una aplicación de .NET que acabo de abrir en Visual Studio 2010 y convertida a 4.0 cuando me lo pidió en la puesta en marcha. Voy a tratar de construir el sitio, y me sale este error:Error al asignar la ruta '/'. .net 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
Probé la solución más popular que encontré vis Google (../ reemplazar y con ~/pero no hay ninguna gustaban ...)
actualización:
búsquedas constructor:
public Lookups()
{
_dirPath = System.Web.HttpContext.Current.Server.MapPath("/") + _xmlPath;
}
¿Tiene una configuración de documento predeterminada? ¿Has configurado las rutas? – Oded
¿Puedes publicar el constructor para la clase 'Lookups'? Obviamente, se está mapeando algo incorrecto. ¿En qué servidor web estás ejecutando esto? ¿Esto está bajo un directorio virtual? Si está utilizando el servidor web incorporado en VS, ¿está ejecutando VS como administrador? – TheCloudlessSky
Me estoy ejecutando usando el servidor web incorporado en VS, sí, me estoy ejecutando como administrador. Firmé que respondería esas dos preguntas. ¿Fui a buscar la clase de búsqueda? – kralco626