Visual Studio build error quot;Illegal characters in pathquot;(Visual Studio 构建错误“路径中的非法字符)
问题描述
当我尝试在包含网站的 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.
- 你有没有遇到过类似的行为?会不会是 VS 的 bug?
- 有没有办法增加网站验证步骤的详细程度,以便我看到有关错误的更多信息?
推荐答案
经过数小时的故障排除后,我尝试使用另一个实例调试 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
- Web 项目的属性页 (Shift+F4)
- 标签开始选项"
- 服务器"部分,值使用自定义服务器"和基本 URL"
一个无效路径的例子是 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 构建错误“路径中的非法字符"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Visual Studio 构建错误“路径中的非法字符"


- 输入按键事件处理程序 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01