Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
873 views
in Technique[技术] by (71.8m points)

asp.net - Visual Studio build error "Illegal characters in path"

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

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. Have you ever experienced a similar behavior ? Could that be a bug of VS ?
  2. Is there a way to increase the verbosity of the Web Site validation step so that I would see more info about the error ?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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 :

It happens when a path containing question mark is set as a base path for the web server deployment, i.e. under

  • web project's property pages (Shift+F4)
  • tab "Start options"
  • section "Server", value "Use custom server" with a "Base URL"

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...