51

I've got a Visual Studio C# project which is under version control (SVN). I've always commited and updated the project without any problems. But a couple of hours ago Visual Studio throws the following error when I try to launch/rebuild the project:

Files has invalid value "<<<<<<< .mine". Illegal characters in path.

I don't know how to fix this problem. What should I do?

bluish
  • 26,356
  • 27
  • 122
  • 180
MysticEarth
  • 2,646
  • 4
  • 33
  • 53

13 Answers13

66

That happens when svn encounters a conflict: You changed a file, the file on the server was changed and it cannot (easily) be merged automatically. You need to decide what is the correct solution now.

Subversion just adds the diff into your source file (and creates files next to it, called OriginalName.mine (unchanged) and OriginalName.rsomething (unchanged, server version)).

Fix the conflict and tell subversion that this is resolved.

Benjamin Podszun
  • 9,679
  • 3
  • 34
  • 45
  • 4
    Thanks all. Found the problem by viewing differences with my working copy, it seemed to be a file in the Debug folder (which I exluded from SVN today). One of my co-workers resolved things while not being resolved.. – MysticEarth Jan 06 '10 at 12:59
  • 2
    Fix the conflict in which of the 3 files? `.mine`? `.rOLDREV`? `.rNEWREV`? Answer: None of them. Instead, fix in the **original** file (that's right: SVN's attempt to commit leaves 4 confusing files) – Withheld Jan 08 '13 at 18:09
41

just delete the obj folder and it will worked fine.

marcg
  • 431
  • 4
  • 2
  • The obj folder has nothing to do with corrupting files by Subversion – MysticEarth Nov 12 '13 at 08:33
  • 4
    @MysticEarth: The error that you have in the subject line comes up sometimes if you try to build before resolving the conflicts, and keeps coming up EVEN AFTER you have resolved it. grepping the directories doesn't turn up anything to do with "<<<<<.mine" because it's embedded in binary form beneath obj; thusly you're none the wiser what is causing the build problem, nor how to fix it. Deleting /obj fixes the problem immediately. So you're wrong, the obj folder has something to do with corrupting files by Subversion. Ho hum. – Brandon Arnold Nov 27 '13 at 19:18
  • +1 this worked for me as well. The "Error List" wasn't listing any specific file and I had manually resolved the conflicts and ReSharper wouldn't see any problems in the solution, and *Find* wouldn't find anything like ".mine", but still VS would refuse to *Build* or even to *Clean*. Deleting the "obj" folder was an instant fix. No need to restart VS. – Mathieu Guindon Jan 24 '14 at 15:30
  • yes it worked fine for me also. I just deleted "obj" folder and it worked fine for me. – Anjan Kant Jun 13 '18 at 09:00
  • Thanks for solution! – Rapunzo Jul 16 '18 at 12:29
11

Remove the code that shouldn't be in the file throwing the error and remove the the three files with extensions .mine, .<somerevision> and .<some_other_revision>. svn updated files that now contain 'conflicts' and you need to resolve these conflicts by hand. Usually this means you edited a file, someone else edited the same file and checked in changes and you didn't pay attention when checking out the changed file.

Confusion
  • 16,256
  • 8
  • 46
  • 71
  • Perhaps a stupid question; but where can I find the .mine files? I can't seem to find them. Also, no file is in conflict and when I search through all files for "mine", nothing is found... – MysticEarth Jan 06 '10 at 12:22
  • Right next to the source file that doesn't compile anymore (because of the conflict markers). Check for files with the same basename, but different extensions. – Benjamin Podszun Jan 06 '10 at 12:33
  • 1
    Well, Visual Studio doesn't give any filename, just the error above. And I don't see any conflict markers... – MysticEarth Jan 06 '10 at 12:35
  • It will either be in the .csproj (or .vcproj or whatever) file or the .sln file. You can use the appropriately titled 'blame' function of svn to see who committed the offending lines. Whoever that is has resolved a conflict incorrectly. – Pike65 Jan 06 '10 at 12:43
  • 3
    Forget Visual Studio for a moment and navigate to the file in the filesystem. You'll find the mentioned files there. You can resolve the conflict from your IDE though (edit the file). Evil train of thoughts: Maybe some of your co-workers managed to check that file in with conflict markers inside..? – Benjamin Podszun Jan 06 '10 at 12:44
  • Thanks all. Found the problem by viewing differences with my working copy, it seemed to be a file in the Debug folder (which I exluded from SVN today). One of my co-workers resolved things while not being resolved.. – MysticEarth Jan 06 '10 at 12:58
10

Delete every thing you have in obj folder .

Remove your obj folder from svn version control . Because on every build it get updated and when other developer commit changes to solution SVN is unable to marge obj folder files and raise error

Files has invalid value "<<<<<<< .mine". Illegal characters in path.

Muhammad Nasir
  • 2,126
  • 4
  • 35
  • 63
6

Please read the Basic Usage chapter in the subversion book. It has a section about Merging conflicts by hand which explains the conflict markers you're seeing.

Wim Coenen
  • 66,094
  • 13
  • 157
  • 251
  • currently i was writing an example of my own, but like always the svnbook has a far more comprehensive one and if you're using Tortoise take a look into http://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html (especially into chapter 4 Daily Usage Guide) – Oliver Jan 06 '10 at 12:54
3

Removing the debug folders worked for me (see comment-not answer above). I got this after moving 12 folders from one section of svn to a new section. So if you get this after moving a project and the error does not point to an actual file, this is likely your issue.

done_merson
  • 2,800
  • 2
  • 22
  • 30
2

If you have AnkhSVN or VisualSVN installed resolving this is most likely as easy as right clicking the file in the solution explorer and selecting edit conflict.

This will open the changed file in your merge editor. (See Tools->Options->Source Control->Subversion User tools for AnkhSVN). With a good merge tool like the free to use SourceGear DiffMerge or TortoiseMerge, resolving the conflict is just a few mouseclicks away.

Bert Huijben
  • 19,525
  • 4
  • 57
  • 73
  • VisualSVN actually does this using TortoiseSVN. You can also do it with TortoiseSVN by right-clicking the file in Windows Explorer and selecting Edit Conflict. – djeidot Aug 29 '11 at 17:21
1

I closed the IDE, then deleted the obj folder and restarted the IDE and rebuilt my Code. This worked for me.

Abhishek
  • 2,925
  • 4
  • 34
  • 59
1
  • Inside your project :

    odj folder -> Debug -> project name.csproj.Filelistabsolute.txt(snb.csproj.Filelistabsolute.txt)

  • Inside the text file >>>>>>>.mine and >>>>>>>.r150 occurs to remove the things the program works

AdrieanKhisbe
  • 3,899
  • 8
  • 37
  • 45
Rajkumar
  • 111
  • 9
1

1)Just save your local changes whatever u have edited in the file

2)revert the file

3)update it from SVN

4)Paste your local changes

Rohan Gala
  • 641
  • 5
  • 18
1

I have had this happen on a large scale where the files get marked resolved but the conflict metadata is still there. I wrote a regular expression for visual studio to find these, for instances where it is not feasible to simply revert the changed files.

http://www.codetunnel.com/blog/post/90/ever-merge-with-svn-and-mess-up-when-resolving-conflicts-read-on

CatDadCode
  • 58,507
  • 61
  • 212
  • 318
0

If you are using TortoiseSVN you should have a right click option on the file called Edit Conflicts. This should bring up TortoiseMerge which is able to read those obnoxious notations stuck into the file (really, to break your code so you KNOW there's an issue and don't blindly check it in).

TortoiseMerge will read it properly and present you with a 3-way merge. This was what I was looking for. Although it is true that it does also create the separate .mine and .rxxx and .ryyy files, and there are various manual and command-line ways to deal with all this.

Josh Sutterfield
  • 1,943
  • 2
  • 16
  • 25
-1

Have a simple solution. just delete all file from debug folder and rebuild the solution, an error display on the screen "There were build errors. Would you like to continue and run the last successful build? click on "Yes" button. Now stop the program and run normally.