174

When I open my solution, I get a dialog with this warning. The solution (one web app, one class project) builds without errors.

How can I determine what properties are causing the problem, and resolve the error?

Ben Mosher
  • 13,251
  • 7
  • 69
  • 80
chris
  • 36,094
  • 53
  • 157
  • 237

16 Answers16

298

I just fixed a similar issue with a VS2010 solution with 35 projects... The cause was a duplicated

GlobalSection(TeamFoundationVersionControl)

section in the solution file. I closed the solution, removed the duplicate GlobalSection(TeamFoundationVersionControl) config and reloaded the solution and the warning message was gone.

If this is not the issue for you, considering you only have 2 projects I would ditch the busted solution file, create a fresh solution and re-add your two projects...

Daniel Daranas
  • 22,454
  • 9
  • 63
  • 116
Boycs
  • 5,610
  • 2
  • 28
  • 23
  • 6
    Had the same problem with VS2012, this solution worked. Thanks! – David Airapetyan Jan 10 '13 at 17:20
  • In my case I didn't strictly have to close the solution. Just edit it in a text editor. When you save, VS will pick up that it was changed and prompt to reload. Thanks for sharing! – LOAS Jan 22 '13 at 10:45
  • You rock, same problem in VS2012. We just switched to a new TFS server and I had the old one with the old TFS URL listed. Removed it, and no more warnings! – Adam Plocher May 09 '13 at 20:33
  • This seems to be a common issue! I have had the same problem and resolved it by nuking the incorrect duplicate and now it loads without a warning – Ben Pretorius May 13 '13 at 12:54
  • 4
    Is it safe to assume that the GlobalSection(TeamFoundationVersionControl) that should be deleted is the bottom one? – frostshoxx Jun 12 '13 at 13:53
  • 4
    I had the same problem and I just removed the bottom one. It solved the problem. It seems that merging sometimes causes this. – MaiOM Mar 03 '14 at 14:35
  • 12
    It was the bottom one for me (it was clearly out of date). I suspect VS uses the first one it finds. In my case this was caused by a TFS merge. – Igby Largeman Mar 25 '14 at 03:43
  • 2
    Same problem in VS2013 with duplicate GlobalSection - fixed by removing – Mark Hosang Nov 11 '14 at 06:04
  • I Had the same problem and all line in the folder had two Tab before them.Removing all TAB from the file and removing the duplicated section resolved the issue for me – Rugdr Jan 15 '15 at 15:03
  • 1
    Jumping on the "Me too" train. This SLN was migrated from VSS and may have been the victim of an automerge. – tsilb Feb 24 '16 at 15:55
  • @frostshoxx Unfortunately not. The GlobalSection(TeamFoundationVersionControl) I needed to keep was the top-most one. Trial and error may be required to figure out which one to keep. – WonderWorker May 10 '17 at 10:35
  • Same problem and fix for VS2015, this time with GlobalSection(CRMSolutionProperties) – IsolatedStorage Feb 27 '18 at 03:24
  • This solution also solved the problem with building my MSBuild project, which gives a meaningless message: error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 2, position 1. Thanks ! – diwatu Apr 10 '18 at 18:47
  • I removed BOTH (all) `GlobalSection(TeamFoundationVersionControl)` sections, reloaded the solution, then re-bound to TFS Source control (File -> Source Control -> Advanced -> Change Source Control). If anything is bound there, just select all entries, and Unbind. Close dialog. Save solution. Re-open "Change Source Control", then bind all entries again. Save and check-in `.sln` file. No more errors. – CJBS Apr 26 '18 at 17:46
  • 3
    7 years later, VS 2019, same problem. :( Surely by now we could get a more helpful error msg. Thanks for the solution! – Eric Vaughan May 31 '19 at 18:03
  • 1
    10 years later, VS 2019, same stupid error message - but this time there is only one section with this name. – Dani Feb 14 '21 at 10:32
  • its 2022/04 and having same issue :D – Mujah Maskey Apr 26 '22 at 14:47
50

The best solution is to force the VS to regenerate the configs. To do this:

  1. Open the sln file with a text editor.
  2. Scroll down till you reach the last "EndProject" element.
  3. Delete everything after that.
  4. Save, Close and rebuild the solution and everything will be regenerated.
Saber
  • 5,150
  • 4
  • 31
  • 43
  • This solution was perfect for my situation. I was getting two similar errors: `The following property is missing or has incorrect value: SccLocalPath63` and `The following property is missing or has incorrect value: SccLocalPath64` – tinonetic Jul 29 '18 at 16:05
  • 2
    This solution worked for me in VS 2017. It actually regenerates that when sln file is opened. Note that EndProject is one word. – Varun Sharma Dec 09 '18 at 07:06
  • This was the fix for me. The only difference in the solution file was the SolutionGuid. – ADH Jan 27 '19 at 14:00
  • 3
    This worked for me in VS 2017. the only thing I have to add is...if youre using Solution Folders...youre going to have to drop your projects back into the correct "slots" – Prisoner ZERO Sep 17 '19 at 16:06
  • 1
    This worked for me in VS 2019. I had duplicate sections as mentioned in other solutions, but when I would remove them, they would come back. This was the only one that worked. – fehays Dec 13 '19 at 17:34
  • Recently my Extensions Manager window stopped working & required an update before it would work again. So I did, and then ran an update for SSIS & also added the Visual Studio Setup Project. After that, ALL of my projects, both VB and SSIS, displayed the message in the OP title. So as indicated on this Answer, I deleted everything after "EndProject" in the SLN file of solutions I'm currently active in, and it stopped the warning messages. – spinjector Sep 24 '22 at 15:06
38

Seems like there is a number of reasons for this warning. I was getting it because my solution file SccNumberOfProjects = 4 when there was only 3.

bicbmx
  • 817
  • 10
  • 8
8

I just fixed a similar issue in VS2012 with 44 projects.

The cause was a combination of a duplicated GlobalSection(TeamFoundationVersionControl) section (a la Boycs' answer), but I also had several projects duplicated--as well as a few references to projects which had been recently removed--within the GlobalSection(TeamFoundationVersionControl) section that I kept.

Once I had ensured that all of the referenced projects corresponded 1:1 with actual projects in my solution, the warning went away.

Aside: I suspect that the majority of these issues could have been avoided with closer attention paid to the .sln during branch and commit merges, but who knows what VS is thinking sometimes...

Ben Mosher
  • 13,251
  • 7
  • 69
  • 80
6

I had a multitude of the errors above. I renamed the project, saved closed, reopened changed the name back. This recreates the .sln file and in my case took out all the extra items.

CThin
  • 156
  • 1
  • 11
  • Easiest fix here. Don't bother digging through the `.sln` looking for the errors. – Jonathan E. Landrum Jun 26 '15 at 13:13
  • Could you expand upon that a bit more. Some users might not understand. Do you mean to rename it in explorer or Visual studio or in the actual file? – iTechy Sep 11 '15 at 18:38
  • 1
    Do this within Visual Studio, You will right click the project, change the name to anything, then save and quit. Reopen and change back to the original, save and quit. reopen the solution and the error should be gone. – CThin Jan 26 '16 at 17:27
4

The other answers already explain how to fix the problem. Maybe I can help to not get the problem again:

How I got the problem Our solution file got mixed up when I added a new project to it, while another developer also added a new project and committed his changes (which I didn't got at my local system). When I started to commit my changes, I had to merge the .sln file, where I obviously messed up :-)

What I learned

Solution files are awful to merge. If you add a project do the following: 1. Get latest Version 2. Add your project 3. Commit

If you see your solution file under pending changes, but you don't see a change in the compare mode, you have to press 'Save All'. While adding your new project, VisualStudio also altered the solution. However, this is an unsaved change at the moment.

TheWho
  • 485
  • 3
  • 17
3

Resolved an identical error message in VS2012 by following Boycs's lead. For me, the problem was two extraneous GlobalSection(SolutionConfigurationPlatforms) = preSolution blocks at the bottom of my SLN file.

BitPusher16
  • 235
  • 2
  • 12
2

For me the problem was empty spaces (due to copy-paste) at the end of each line. By removing them I didn't get the error again.

papaiatis
  • 4,231
  • 4
  • 26
  • 38
2

In VS 2015, I had two of these sections "GlobalSection(TeamFoundationVersionControl) = preSolution"

The first one included the latest project added to the solution, the second one (near the end of the solution file) did not. After deleting the second one, the solution opened in VS 2015 without any errors.

Papa Stahl
  • 687
  • 8
  • 7
1

Check your SccNumberOfProjects in your .sln file it may be differs from your actual project number.

Ali Karaca
  • 3,365
  • 1
  • 35
  • 41
0

i fixed similar problem in vs2012.

in my case the problem was that the SccProjectName0 property value inside GlobalSection in the MySolutionName.sln file was empty.

i solved it by setting SccProjectName0 value with copy of this string value from another solution, and replacing the name of the project in the string to the current one (BTW - if your project name as space in it (' '), it need to replace with '\u0020').

*

in my case the problem begin after i mistakenly opened solution controlled by TFS with old MySolutionName.sln file of the same solution from time that this solution was controlled by VSS.

Yossi B
  • 51
  • 1
  • 7
0

VS2015 Update 3. [GlobalSection(TeamFoundationVersionControl) = preSolution] was duplicated in solution file. The bottom duplicate contained a project that has previously removed... so removing that duplicate fixed the issue. I think the duplication was caused by a previous merging problem.

Moutono
  • 181
  • 2
  • 11
0

I can add one more possible solution - A dodgy merge meant that one of the SccProjectUniqueName/SccProjectName/SccLocalPath stanzas inside the GlobalSection(TeamFoundationVersionControl) section had numbers that weren't unique, even though the SccNumberOfProjects was correct. Fixed up the numbering, error message went away.

Julian Melville
  • 185
  • 2
  • 9
0

VS 2019 - I was opening a VS 2017 project for the first time in VS 2019. In the Output window, click the "Show output from:" DDL and review your options because you may see additional error information.

In my case, the solution was to just re-configure my source control mappings for 2019.

  • Go into Team Explorer
  • Click the Manage Connections button (plug)
  • Click Manage Connections link and Connect to a Project...
  • ...
GrayDwarf
  • 2,469
  • 2
  • 20
  • 22
0

For my case, it was the order of projects, make sure following tags with number at end are consistent and sequential.

  1. SccProjectUniqueName
  2. SccProjectTopLevelParentUniqueName
  3. SccProjectName
  4. SccLocalPath
Srinivas Ch
  • 66
  • 1
  • 6
-1

I had the same problem, and my solution is:

  1. Open the solution in VS
  2. Set the Solution Platform to Default
  3. Save it
  4. Close the VS
  5. Open the .sln file in Notepad++ (or any other editor)
  6. Delete all of the other Solution Platform item from everywhere
  7. (for example:{73E03C8F-1F76-45E2-9D45-FA040A63F0AA}.Release|Any CPU.Build.0 = Release|Any CPU)
  8. Save it, and reopen the solution.

This works for me.