Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 ?
like image 204
Tomas Vana Avatar asked Dec 12 '22 05:12

Tomas Vana


2 Answers

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.

like image 148
Tomas Vana Avatar answered Dec 14 '22 18:12

Tomas Vana


If you are facing this problem after pulling from git , then you can follow it:

Step 1:

go to obj\Debug folder then find yourProject.csproj.FileListAbsolute.txt file open it then delete what you found in building the project. In my case i found ====>Head problem in building the project. it followed the above step , and my problem solved.

Step 2:

delete obj folder then rebuild the project.

like image 45
Nur Uddin Avatar answered Dec 14 '22 18:12

Nur Uddin