开发者

Visual Studio warning: "Some of the properties associated with the solution could not be read"

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?


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...


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.


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.


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...


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.


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.


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.


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.


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.


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


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.


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.


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.


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...
  • ...


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜