当我尝试在包含网站的 Visual Studio (2010 SP1) 中构建我的解决方案时,我收到以下有趣的错误.
When I try to build my solution in Visual Studio (2010 SP1) containing a website, I get the following funny error.
------ Build started: Project: C:...Web, Configuration: Debug Any CPU ------
Validating Web Site
: Build (web): Illegal characters in path.
Validation Complete
没有更多信息,即使构建详细程度设置为诊断.我试图删除所有我能找到的临时文件,重新启动我能做的一切.我什至从头开始重新获取我的整个 svn 文件夹并重建.. 错误仍然存在.然后,非常随机地,错误消失了.现在,大约一天后,它又回来了.
There is no more info whatsoever, even when build verbosity is set to diagnostic. I've tried to delete all the temporary files I could find, to restart everything I could. I even refetched my whole svn folder from scratch and rebuilt.. error still there. Then, quite randomly, the error disappeared. Now, about a day later, it's back.
经过数小时的故障排除后,我尝试使用另一个实例调试 Visual Studio 并了解异常的内部情况.结果,我找到了错误的实际原因:
After hours of troubleshooting I tried to debug visual studio with another instance and get to the internals of the exception. As a result, I have found the actual reason of the error :
当包含问号的路径被设置为 Web 服务器部署的基本路径时,即在
It happens when a path containing question mark is set as a base path for the web server deployment, i.e. under
一个无效路径的例子是 http://localhost/v8.0/xyz?user=User1
.原因是构建过程在末尾添加了一个额外的斜线.不幸的是VS非常坚持使用旧的设置值,所以在重建之前必须重新启动它.
An example of an invalid path is http://localhost/v8.0/xyz?user=User1
. The reason is that the build process adds an additional slash at the end. Unfortunately VS is quite persistent in using the old setting value, so one has to restart it before rebuilding.
这篇关于Visual Studio 构建错误“路径中的非法字符"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!