为了明天

时光匆匆流逝, 笑看风起云落 - 流浪的狗2012

导航

关于vs 2005的一个问题, 解决The path "xxxx' maps to a directory outside this application, which is not supported.

具体表现为, vs2005下新建一个基于http方式的website, 访问任何页面都出现黄页错误信息, 具体的错误信息

Server Error in '/Study2006/WetStudyHttp' Application.
--------------------------------------------------------------------------------

The path '/Study2006/WetStudyHttp/App_GlobalResources/' maps to a directory outside this application, which is not supported. 

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.Web.HttpException: The path '/Study2006/WetStudyHttp/App_GlobalResources/' maps to a directory outside this application, which is not supported.


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42 

这个问题困扰多日, 一直没有找到合适的办法解决.
但是新建一个基于file system的website就不会出现这样的错误, 虽然这样也可以, 但是总感觉不爽啊.

把vs2005卸载了重装了N次, 这个问题依旧.

今天不甘心, 又上网搜了一下这方面的东西, 可惜还是没有一个正确的方法来解决问题.

后来偶然的切换到asp.net2.0的配置标签上, 突然发现了异常之处, 看下面的图.

vs2005error.gif

我把这个web.config的路径copy到资源管理器里面, 果然提示找不到该文件, 看来就是这个地方出现的问题了.

马上打开iis的根目录一看, 我的根目录是指向如下的地址:

iisroot.gif

就是这个iis根目录后面的这个反斜线出的问题, 我新建的website会去找相应的配置文件的时候
都会在iis根目录的后面自动又加上了一个反斜线, 所以造成的路径 E:\Project\\xxx 无效.

我把iis的根目录由 E:\Project\ 去掉后面的反斜线, 改为 E:\Proect 一切正常了.

但是显示出来的错误信息并没有把这个路径完全的show出来, 这样就给我们一个莫名其妙的错误信息.
如果能显示一个完整的路径, 我想, 这个问题就不会困扰我这么久了.

posted on 2006-03-02 10:45  流浪的狗  阅读(4334)  评论(10编辑  收藏  举报