mono上的asp.net无法映射路径'/';
我在Centos 6.4上从源代码安装了mono,以测试msc asp网站。 它似乎工作得很好 某些页面返回此错误mono上的asp.net无法映射路径'/';,asp.net,mono,Asp.net,Mono,我在Centos 6.4上从源代码安装了mono,以测试msc asp网站。 它似乎工作得很好 某些页面返回此错误 System.InvalidOperationException Failed to map path '/' Description: HTTP 500.Error processing request. Details: Non-web exception. Exception origin (name of application or object): System.W
System.InvalidOperationException
Failed to map path '/'
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object):
System.Web.
at System.Web.HttpRequest.MapPath (System.String virtualPath, System.String baseVirtualDir, Boolean allowCrossAppMapping) [0x00000] in <filename unknown>:0
at System.Web.HttpRequest.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Hosting.HostingEnvironment.MapPath (System.String virtualPath) [0x00000] in <filename unknown>:0
at System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists (System.String virtualDir) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.FindWebConfig (System.String path, System.Boolean& inAnotherApp) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration (System.String path, System.String site, System.String locationSubPath, System.String server, System.String userName, System.String password, Boolean fweb) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path) [0x00000] in <filename unknown>:0
at System.Web.Security.SqliteMembershipProvider.Initialize (System.String name, System.Collections.Specialized.NameValueCollection config) [0x00000] in <filename unknown>:0
at System.Web.Configuration.ProvidersHelper.InstantiateProvider (System.Configuration.ProviderSettings providerSettings, System.Type providerType) [0x00000] in <filename unknown>:0
at System.Web.Configuration.ProvidersHelper.InstantiateProviders (System.Configuration.ProviderSettingsCollection configProviders, System.Configuration.Provider.ProviderCollection providers, System.Type providerType) [0x00000] in <filename unknown>:0
at System.Web.Security.Membership..cctor () [0x00000] in <filename unknown>:0
System.invalidoOperationException
未能映射路径“/”
描述:HTTP 500。处理请求时出错。
详细信息:非web异常。异常来源(应用程序或对象的名称):
System.Web。
位于System.Web.HttpRequest.MapPath(System.String virtualPath、System.String baseVirtualDir、布尔allowCrossAppMapping)[0x00000]中:0
位于:0中的System.Web.HttpRequest.MapPath(System.String virtualPath)[0x00000]处
位于:0中的System.Web.Hosting.HostingEnvironment.MapPath(System.String virtualPath)[0x00000]处
位于System.Web.Hosting.DefaultVirtualPathProvider.DirectoryExists(System.String virtualDir)[0x00000]中:0
在:0中的System.Web.Configuration.WebConfiguration Manager.FindWebConfig(System.String路径、System.Boolean和InOtherApp)[0x00000]处
在System.Web.Configuration.WebConfiguration Manager.OpenWebConfiguration(System.String路径、System.String站点、System.String位置子路径、System.String服务器、System.String用户名、System.String密码、布尔fweb)[0x00000]中:0
位于:0中的System.Web.Configuration.WebConfiguration Manager.GetSection(System.String sectionName、System.String路径、System.Web.HttpContext上下文)[0x00000]处
在:0中的System.Web.Configuration.WebConfiguration Manager.GetSection(System.String sectionName,System.String路径)[0x00000]处
在:0中的System.Web.Security.SqlItemMemberShipProvider.Initialize(System.String名称,System.Collections.Specialized.NameValueCollection配置)[0x00000]处
位于:0中的System.Web.Configuration.ProvidersHelper.InstanceProvider(System.Configuration.ProviderSettings ProviderSettings,System.Type providerType)[0x00000]处
在System.Web.Configuration.ProvidersHelper.InstanceProviders(System.Configuration.ProviderSettings集合配置提供程序,System.Configuration.Provider.ProviderCollection提供程序,System.Type providerType)[0x00000]中:0
位于System.Web.Security.Membership..cctor()[0x00000]中:0
我在debian上做了同样的事情,效果很好
您有什么建议吗?找到所有的Server.mappath并从 Server.MapPaths(@“\”) 到
Server.MapPaths(Path.directoryseportorchar)我有相同的错误,堆栈跟踪完全相同。 它仅在apache刚启动时第一次请求时发生。在第一次请求之后没有发生错误 我通过删除WebMatrix.WebData.dll解决了这个问题
当您使用SimpleMembershipProvider时,这可能会产生一些后果,并且可能会影响MVC4上的OpenAuth功能。您是否检查了视图文件中的路径?作为提醒: “/”与
中的类似,映射到/sites available/.conf上定义的DocumentRoot文件夹,它可能类似于/var/www
类似于
中的“~/”映射到mvc应用程序所在的路径,它可能类似于/var/www/site1
“../”将尝试访问DocumentRoot文件夹上方的一个文件夹。这实际上可能是由apache站点配置(推荐)决定的
还要注意,如果您从monodevelop/xspServer运行mvc应用程序,文档根目录和mvc应用程序路径实际上是相同的,但是如果您在apache上安装mvc应用程序,它们可能不是相同的路径 发生此错误是因为mono System.Web中存在错误 它包含此支票() 要解决这个问题,您可以在Mono surce代码中注释这些行并重新编译Mono。 这个bug也出现在最新的Mono中 链接:
if (!isAppVirtualPath && !virtualPath.StartsWith (appVirtualPath, RuntimeHelpers.StringComparison))
throw new InvalidOperationException (String.Format ("Failed to map path '{0}'", virtualPath));