Visual Studio build error "Illegal characters in path"

27,672

Solution 1

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.

Solution 2

Possible solution (found here, russian language):

  1. Create folder with simple and latin-only path - for example, c:\Temp
  2. (Assuming you're using Win7) go to Control Panel->System->Advanced System Settings->Advanced->Environment Variables
  3. Change "TMP" and "TEMP" variables from "%USERPROFILE%\AppData\Local\Temp" to "C:\Temp" and press OK in all open dialogs
  4. Restart Visual Studio

Solution 3

In my case - move solution to place with short path and use latin characters. Example:

C:/Projects/MyProject/

Solution 4

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.

Solution 5

I had the same problem with Visual Studio Community 2013, with Windows 8.1 (brazilian portuguese). Change of "TMP" and "TEMP" variables works fine for me.

Share:
27,672
Tomas Vana
Author by

Tomas Vana

Developer living in a lovely city of Vienna in Austria, Europe. At work doing mostly .NET and web development, intranet web applications and data warehousing solutions. For fun developing iPhone Apps, with the first one released recently at AppStore.

Updated on May 22, 2020

Comments

  • Tomas Vana
    Tomas Vana almost 4 years

    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 ?