Reputation:
Yesterday I made some changes for my solution such as renamed it and moved to a different location in TFS 2013 server.
Today I received the message
“One or more projects in the solution were not loaded correctly. Please see the Output Window for details”
when opening a solution in Visual Studio:
Unfortunatley the details in the output window were not very helpful:
Some of the properties associated with the solution could not be read
I only have one project in the solution. Here is the solution file.
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GenericIVR", "OutboundGeneric\GenericIVR.csproj", "{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}"
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 1
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = http://tfs01:8080/tfs/software%20repository
SccProjectUniqueName0 = OutboundGeneric\\GenericIVR.csproj
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
AnotherDebug|Any CPU = AnotherDebug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.AnotherDebug|Any CPU.ActiveCfg = AnotherDebug|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.AnotherDebug|Any CPU.Build.0 = AnotherDebug|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Upvotes: 12
Views: 11172
Reputation: 1
I use VS2017.
I tried to delete everything between "Global" and "EndGlobal" as the answer in this post. It works. Then I find the reason why it works: it makes VS delete all "Release" configuration in all .csproj.
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
I guess the problem in my case was caused by using "Release" configuration to build then went back to “Debug” configuration to code & debug.
Upvotes: 0
Reputation: 1
Even i faced same issue but found that SccNumberOfProjects = 11 where i have only 10 projects in my solution, so i have changed 10 insteadof 11, now it is working fine.
Upvotes: 0
Reputation: 504
Just fixed the issue in VS2015 by editing the .sln
file...
Every entry in
GlobalSection(ProjectConfigurationPlatforms) = postSolution sections
needed to have both entries for each configuration
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B46A2C8-B9FF-48F3-978D-CF27B1EC917D}.Debug|Any CPU.Build.0 = Debug|Any CPU
When
solution could not be read
occurred, only the ActiveCfg
entry was present. Added the Build.0
entry where it was omitted and
solution could not be read
was corrected.
Upvotes: 0
Reputation: 759
I'm not exactly sure what caused this for me, but my solution was to delete everything between "Global" and "EndGlobal" and then open the solution. It rebuilt the solution file and works fine. Comparing the old and new, it seems probable that there was extraneous info within GlobalSection(SolutionConfigurationPlatforms) = preSolution
Before:
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Default = Debug|Default
Release|Any CPU = Release|Any CPU
Release|Default = Release|Default
EndGlobalSection
After
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
Upvotes: 3
Reputation: 959
Similar answer to anhoppe, but with a couple of differences.
I had a situation where a merge of a .sln file had resulted in 2 separate GlobalSection(TeamFoundationVersionControl) sections, the first had the incorrect number of projects in it, the second had the correct number.
I initially deleted the first GlobalSection(TeamFoundationVersionControl) and left the second one in place. This didn't work and I still saw the error...
Some of the properties associated with the solution could not be read
So, I undid this change and then deleted just the second GlobalSection(TeamFoundationVersionControl), saved and re-opened the solution. This did the job and I just had to re-add the couple of projects that had been taken out of source control.
Upvotes: 1
Reputation: 4497
I also had a similar problem, in my case I had two GlobalSection(TeamFoundationVersionControl) = preSolution sections in my sln. I manually removed the content of the section (and deleted the 2nd entirely). Then I opened my solution and got an error 'solution not under source control'. Then I Added it to source control again via Add to Source Control. Then I saved everything and the section was restored.
Upvotes: 4
Reputation: 51
Following on from the suggestion above, I found that in my case the solution file had an incorrect number of SccNumberOfProjects configured. Somehow I had managed to get 15, a quick count and correction of the number of projects contained in the solution fixed it for me.
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 13
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
Upvotes: 5
Reputation: 10080
Edit your GlobalSection(TeamFoundationVersionControl) = preSolution section with the following lines after "SccTeamFoundationServer":
SccLocalPath0 = .
SccProjectUniqueName1 = OutboundGeneric\\GenericIVR.csproj
SccProjectName1 = GenericIVR
SccLocalPath1 = GenericIVR
Don't ask me why that SccLocalPath0 should be present, but I have seen it in the older VS version too.
Upvotes: 6