mosquito87
mosquito87

Reputation: 4440

Error MSB3541: Files has invalid value

I just deployed an asp.net mvc 3 web application to AppHarbor but it failed:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(3932,5): error MSB3541: Files has invalid value "<<<<<<< HEAD". Illegal characters in path. [D:\temp\q5cmde4m.uk1\input\MyProject\MyProject.csproj]

This happened after I opened the project with Visual Studio 2012 (the application was created with VS2010).

Upvotes: 58

Views: 66397

Answers (8)

lemmy osiki
lemmy osiki

Reputation: 1

Error MSB3541 Files has invalid value "<<<<<<< HEAD". Illegal characters in path. PayBuddy.Domain C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets 5476

Deleting the obj folder rectified the issue

Upvotes: 0

IsuruA
IsuruA

Reputation: 21

Error 128 Files has invalid value "<<<<<<< HEAD". Illegal characters in path

Delete the obj folder and rebuild the project rectified the issue

Upvotes: 0

Walter P Steiner
Walter P Steiner

Reputation: 11

Ok this might be helpful to someone else.

in my case my .vbproj file and some form files somehow had the last lines of its code truncated, I fixed this by restoring this missing part of the code (around the last 10 lines were missing) from a previous backup of the same project.

The other files got corrupted in a simillar way and were fixed by restoring the missing parts of the files from the backed up ones on a text editor (notepad)

After getting this the project loaded without issue.

Upvotes: 1

juniorjblp
juniorjblp

Reputation: 21

Yes, it is about merging conflicts. Usually Visual Studio highlights most of the errors with file paths. However, it does miss some files. All you have to do is REMOVE the "obj" an "bin" folder from your solution.

If you are in Visual Studio, you have to select "Show All/Hidden files" as "obj" folder is hidden, and then delete it.

You can also delete it by going to your directory where your project is stored e.g C:/Users/username/source/repos/project/ (can be different in your case).

Upvotes: 2

Ishwor Khanal
Ishwor Khanal

Reputation: 1390

Delete both obj and bin folder it will fix the issue, which in my cas its been done and it was causing when create pull request from remote repository !!

Upvotes: 0

Iftikhar Ali Ansari
Iftikhar Ali Ansari

Reputation: 1760

though it is very old question but I would like to add an answer here. when you work with multiple developer in visual studio you should git ignore obj folder, .suo,.sln etc which is only holding the visual studio information user based.

refer to this SO question

Upvotes: 5

Sohil Bhayani
Sohil Bhayani

Reputation: 611

Delete the obj folder within your project and it will fix the issue.

Upvotes: 61

Razvan
Razvan

Reputation: 3152

Try to search the entire solution for the value and remove it from where it occurs, and then delete the obj folder from your project. When you build again it should work.

The obj folders are hidden in Visual Studio. You can see them with a file explorer.

Upvotes: 153

Related Questions