Visual Studio 构建错误“路径中的非法字符"

时间:2023-02-17
本文介绍了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.

  1. 你有没有遇到过类似的行为?会不会是 VS 的 bug?
  2. 有没有办法增加网站验证步骤的详细程度,以便我看到有关错误的更多信息?

推荐答案

经过数小时的故障排除后,我尝试使用另一个实例调试 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 构建错误“路径中的非法字符"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

上一篇:如何在 msbuild.exe 或 .csproj 文件中指定/features:strict (of csc.exe) 下一篇:可以通过批处理文件以编程方式删除和添加对 csproj 的引用吗?

相关文章

最新文章