【发布时间】:2013-08-05 02:09:06
【问题描述】:
好吧,我想不通。我有一个测试 MVC 应用程序(razoronmono)。我今天刚从master编译了mono,还有xsp。我今天也编译了nginx。我正在运行 Ubuntu 13.04 最小版本。
这有效: http://coh2.us.to/razoronmono/
这不会: http://coh2.us.to/apps/razoronmono/
子目录中的所有代码都是一样的...
applications="/:/srv/www,/razoronmono:/srv/www/razoronmono,/apps/razoronmono:/srv/www/apps/razoronmono"
nginx 配置: 位置 / {
}
location /razoronmono {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /;
}
location /apps/razoronmono {
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /;
}
location ~ \.(aspx|asmx|ashx|asax|ascx|soap|rem|axd|cs|config|dll)$ {
fastcgi_pass 127.0.0.1:9000;
include /etc/nginx/fastcgi_params;
}
我收到以下错误:
System.InvalidOperationException 无法映射路径 '/apps/_ViewStart.cshtml'
描述:HTTP 500.Error processing request.
详细信息:非网络异常。异常来源(应用程序名称或 对象):System.Web。异常堆栈跟踪:在 System.Web.HttpRequest.MapPath (System.String virtualPath, System.String baseVirtualDir,布尔值 allowCrossAppMapping) [0x001a4] 在 /usr/src/mono/mcs/class/System.Web/System.Web/HttpRequest.cs:1572 在 System.Web.HttpRequest.MapPath (System.String virtualPath) [0x0000d] 在 /usr/src/mono/mcs/class/System.Web/System.Web/HttpRequest.cs:1526 在 System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00042] 在 /usr/src/mono/mcs/class/System.Web/System.Web.Hosting/HostingEnvironment.cs:156 在 System.Web.Hosting.DefaultVirtualPathProvider.FileExists (System.String virtualPath) [0x00016] 在 /usr/src/mono/mcs/class/System.Web/System.Web.Hosting/DefaultVirtualPathProvider.cs:68 在 System.Web.WebPages.FileExistenceCache.FileExists (System.String virtualPath) [0x00000] in :0 at System.Web.WebPages.VirtualPathFactoryManager.PageExistsInVPP (System.String virtualPath, Boolean useCache) [0x00000] in :0 at System.Web.WebPages.VirtualPathFactoryManager.PageExists (System.String virtualPath, Boolean useCache) [0x00000] in :0 at System.Web.WebPages.WebPageExecutingBase.FileExists (System.String path, Boolean useCache) [0x00000] in :0 at System.Web.WebPages.StartPage.GetStartPage (System.Web.WebPages.WebPageRenderingBase 页面,System.String 文件名,IEnumerable
1 supportedExtensions) [0x00000] in <filename unknown>:0 at System.Web.Mvc.RazorView.RenderView (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer, System.Object instance) [0x00000] in <filename unknown>:0 at System.Web.Mvc.BuildManagerCompiledView.Render (System.Web.Mvc.ViewContext viewContext, System.IO.TextWriter writer) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ViewResultBase.ExecuteResult (System.Web.Mvc.ControllerContext context) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResult (System.Web.Mvc.ControllerContext controllerContext, System.Web.Mvc.ActionResult actionResult) [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerActionInvoker+<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19 () [0x00000] in <filename unknown>:0 at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter (IResultFilter filter, System.Web.Mvc.ResultExecutingContext preContext, System.Func1 继续)[0x00000] in :0
【问题讨论】: