iis7 未能映射路径径问题,怎么解决

分析器错误怎么解决说明: 在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误消息: 未能映射路径“/MyBlog/include/common_function.inc”。源错误: 行 6:
在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。 分析器错误消息: 未能映射路径“/MyBlog/include/common_function.inc”。源错误:
为您推荐:
扫描下载二维码本帖子已过去太久远了,不再提供回复功能。未能映射路径
未能映射路径
I have an ASP.Net website solution in Visual Studio, and when trying to Server.MapPath(@"\");I receive the following error. I know this question has been asked before but I am yet to find a solution that has worked for me. Any ideas would be great.
Failed to map the path '/'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Failed to map the path '/'.
Source Error:
protected void Page_Load(object sender, EventArgs e)
string directory = Server.MapPath(@"\");
Response.Write(directory);
Source File: c:\Users\Josh\Documents\Visual Studio 2010\WebSites\MMCR\About.aspx.cs
Stack Trace:
[InvalidOperationException: Failed to map the path '/'.]
System.Web.Hosting.HostingEnvironment.MapPathActual(VirtualPath virtualPath, Boolean permitNull) +8937646
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
About.Page_Load(Object sender, EventArgs e) in c:\Users\Josh\Documents\Visual Studio 2010\WebSites\MMCR\About.aspx.cs:12
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
日55分12秒
If all of the others suggested solution if not working it means that your Visual Studio doesn't have a administrative privileged.
Hence you may run the Visual Studio "Run as Administrator" and try to execute once again.
日55分12秒
Server.mapPath("~/");
日55分12秒
if none of the answers here
help, try Server.MapPath(@".\");. This and your code worked for me, and produced the same results.
日55分12秒
& 2016 91R.NET 版权所有本帖子已过去太久远了,不再提供回复功能。

我要回帖

更多关于 asp.net 未能映射路径 的文章

 

随机推荐