GlobalSection ExtensibilityGlobals is repeated in .sln file - visual-studio

I checked almost all questions w.r.t this on stack overflow, but didn't find appropriate answer.
In my project solution file I can see a repeated entry for GlobalSection with SolutionGuid, as follows:
Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(SubversionScc) = preSolution
Svn-Managed = True
Manager = AnkhSVN2019 - Subversion Support for Visual Studio
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3949C94-3551-44F7-BE8B-1FFE4A668402}
EndGlobalSection
EndGlobal
Every time when I open solution in VS2019 creates a new entry of GlobalSection. This should not happen usually a .sln file should have only one section for SolutionGuid. Due to this modification in .sln file, source control detects this as a change and we have to commit or revert it every time.
As you can see GlobalSection for SolutionGuid entry is repeated 7 times with the same GUID. why? How to fix this or this is a bug?

Related

Build-Infos of unknown project (GUID) automatically added to .sln

I recently migrated a project from SVN to Git and did also an update from Visual Studio 2008 to Visual Studio 2019 (via the built-in update-service from Visual Studio).
Now I have found, that in the .sln, GlobalSection(ProjectConfigurationPlatforms) there were four lines newly added, two of them seem to be build-references of some sort with a Project-GUID which appears nowhere else in the .sln.
I manually searched my solution for the GUID, but couldn't find any other appearances of it.
My question is: where does that come from? Any ideas?
Here is the code (the two lines are marked with "unknown GUID"):
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29306.81
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XYGatewayModel", "..\..\Common\XYGatewayModel\XYGatewayModel.csproj", "{21B09837-AAB6-4504-A215-E27136C5E5FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ABGateway", "..\..\Common\ABGateway\ABGateway.csproj", "{677D56B6-EB24-4E22-AB6C-F74C21D730D9}"
EndProject
Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "ABGatewaySQLSchema", "..\..\Common\ABGatewaySQLSchema\ABGatewaySQLSchema.sqlproj", "{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}"
EndProject
Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "CDInterface", "..\..\Common\CDInterface\CDInterface.tsproj", "{2CFF2AFB-A6DC-441C-91E4-14183B2A64A9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{21B09837-AAB6-4504-A215-E27136C5E5FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{21B09837-AAB6-4504-A215-E27136C5E5FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21B09837-AAB6-4504-A215-E27136C5E5FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21B09837-AAB6-4504-A215-E27136C5E5FA}.Release|Any CPU.Build.0 = Release|Any CPU
{677D56B6-EB24-4E22-AB6C-F74C21D730D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{677D56B6-EB24-4E22-AB6C-F74C21D730D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{677D56B6-EB24-4E22-AB6C-F74C21D730D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{677D56B6-EB24-4E22-AB6C-F74C21D730D9}.Release|Any CPU.Build.0 = Release|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Release|Any CPU.Build.0 = Release|Any CPU
{972FA4A7-7AE3-4116-BE0B-EA569D1A186E}.Release|Any CPU.Deploy.0 = Release|Any CPU
{2CFF2AFB-A6DC-441C-91E4-14183B2A64A9}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x86) // <-- new
{2CFF2AFB-A6DC-441C-91E4-14183B2A64A9}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x86) // <-- new
{A4E497EA-EA8E-451C-AA46-1945E311BFC9}.Debug|Any CPU.ActiveCfg = Debug|TwinCAT RT (x86) // <-- new <-- unknown GUID
{A4E497EA-EA8E-451C-AA46-1945E311BFC9}.Release|Any CPU.ActiveCfg = Release|TwinCAT RT (x86) // <-- new <-- unknown GUID
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {29FA54F4-4C76-4126-8956-377B9B680D2B}
EndGlobalSection
EndGlobal

TFS solution thinks it is still under version control

I have unbound all projects from TFS version control, but every time I open the solution it pops-up a dialog asking me if I want to connect to TFS.
Q: How do I get rid of it?
Found it!
I had to go into the SOLUTION FILE and remove the following (by-hand)
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 8
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = https://yournamehere.visualstudio.com/
SccLocalPath0 = .
SccProjectUniqueName1 = Data\\Data.csproj
SccProjectTopLevelParentUniqueName1 = Guardians.sln
SccProjectName1 = Data
SccLocalPath1 = Data
SccProjectUniqueName2 = Framework\\Framework.csproj
SccProjectTopLevelParentUniqueName2 = Guardians.sln
SccProjectName2 = Framework
SccLocalPath2 = Framework
SccProjectUniqueName3 = Models\\Models.csproj
SccProjectTopLevelParentUniqueName3 = Guardians.sln
SccProjectName3 = Models
SccLocalPath3 = Models
SccProjectUniqueName4 = Dictionary\\Dictionary.csproj
SccProjectTopLevelParentUniqueName4 = Guardians.sln
SccProjectName4 = Dictionary
SccLocalPath4 = Dictionary
SccProjectUniqueName5 = Web\\Web.csproj
SccProjectTopLevelParentUniqueName5 = Guardians.sln
SccProjectName5 = Web
SccLocalPath5 = Web
SccProjectUniqueName6 = Cloud\\Cloud.ccproj
SccProjectTopLevelParentUniqueName6 = Guardians.sln
SccProjectName6 = Cloud
SccLocalPath6 = Cloud
SccProjectUniqueName7 = UnitTests\\UnitTests.csproj
SccProjectTopLevelParentUniqueName7 = Guardians.sln
SccProjectName7 = UnitTests
SccLocalPath7 = UnitTests
EndGlobalSection
In the solution's and projects' folders you will find *.vspscc files which are responsible of version control, remove them all and your problem should be fixed.
There is also a .vs and $tf hidden folders, you need to remove those also.

Why do source control entries keep getting added back to my .sln file?

I was able to finally get a legacy ASP.NET project to run which I have been tasked to maintain. A question about it and my tentative auto-answer is here.
In a nutshell, it seems one of the things I needed to do to get it to run was to clean out the TFS files and sections referring to them in the .sln file.
As to the latter, I remove these entries from the solution (.sln) file:
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
...but they have been added back for some reason, so that my .sln contains them again, and for context/full disclosure is:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.40629.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "MembersOrderEntry", "MembersOrderEntry", "{7D7D3972-0891-4600-BCBC-
CA40B0D0FF6E}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
Debug.AspNetCompiler.VirtualPath = "/MembersOrderEntry"
Debug.AspNetCompiler.PhysicalPath = "MembersOrderEntry\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\MembersOrderEntry\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/MembersOrderEntry"
Release.AspNetCompiler.PhysicalPath = "MembersOrderEntry\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\MembersOrderEntry\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "2030"
VWDDynamicPort = "false"
SlnRelativePath = "MembersOrderEntry\"
DefaultWebSiteLanguage = "Visual Basic"
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D7D3972-0891-4600-BCBC-CA40B0D0FF6E}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Why are the "SAK" entries added back, and how can I prevent that from occurring again? This project is not under source control.
When I open the solution, I see a message that says, "...mappings could not be found ... temporarily disconnected..." Why is it even expecting to find mappings?
The folder that the project exists in is mapped to TFS as a Workspace. You will need to move the files or remove the workspace or Visual Studio will keep adding Source Control back.

Setting solution configurations in visual studio custom wizard

I have created a custom wizard for visual studio 2010. I can setup the the project configurations but I need I can't find how to set the solution configurations.
Below is an abstract from my code to setup a project configuration from default.js. How can I do a similar thin for the solution?
var debugConfig = proj.Object.Configurations('Debug');
debugConfig.OutputDirectory = '$(ProjectDir)$(ConfigurationName)';
debugConfig.IntermediateDirectory = '$(ConfigurationName)';
debugConfig.ConfigurationType = typeStaticLibrary;
debugConfig.CharacterSet = charSetUnicode;
var CLTool = debugConfig.Tools('VCCLCompilerTool');
CLTool.Optimization = optimizeDisabled;
CLTool.AdditionalIncludeDirectories = '.;$(COREDIR)/cliprt';
CLTool.PreprocessorDefinitions = 'WIN32;_DEBUG;_LIB;CLP_PLATFORM_WIN32';
CLTool.MinimalRebuild = 'true';
CLTool.BasicRuntimeChecks = runtimeBasicCheckAll;
CLTool.RuntimeLibrary = rtMultiThreadedDebug;
CLTool.UsePrecompiledHeader = pchNone;
CLTool.WarningLevel = warningLevel_3;
Update
I recently migrated from Visual Studio 2008 to Visual studio 2010. When I checked back at the 2008 version I noticed that it was behaving as required ie the new configurations were added for both the solution and the project. Is there a known difference in this respect between studio 2008 and 2010?
Ok
I have a solution now. I modified the above code to look like this.
var solCurrentConfig = Solution.SolutionBuild.SolutionConfigurations.Add('AutonomousDebug', 'Debug', true);
var currentConfig = proj.Object.Configurations('AutonomousDebug');
debugConfig.CopyTo( currentConfig );
currentConfig = proj.Object.Configurations('AutonomousDebug');
currentConfig.OutputDirectory = '$(SolutionDir)$(Configuration)';
currentConfig.IntermediateDirectory = '$(Configuration)/';

Error when opening visual studio 2010 solution file

I have a solution file that only contains one web application project. Everytime I open that file, this message always pops up:
Then in the output window it says:
Some of the properties associated with the solution could not be read.
And here is the solution file's text:
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "Web Application", "..\Web
Application", "{2D32A179-D771-4510-9C8B-D17D50BE3AAE}"
ProjectSection(WebsiteProperties) = preProject
SccProjectName = "SAK"
SccAuxPath = "SAK"
SccLocalPath = "SAK"
SccProvider = "SAK"
TargetFrameworkMoniker = ".NETFramework,Version%3Dv3.5"
Debug.AspNetCompiler.VirtualPath = "/Web Application"
Debug.AspNetCompiler.PhysicalPath = "D:\Projects\Web Application\"
Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\Web Application\"
Debug.AspNetCompiler.Updateable = "true"
Debug.AspNetCompiler.ForceOverwrite = "true"
Debug.AspNetCompiler.FixedNames = "false"
Debug.AspNetCompiler.Debug = "True"
Release.AspNetCompiler.VirtualPath = "/Web Application"
Release.AspNetCompiler.PhysicalPath = "D:\Projects\Web Application\"
Release.AspNetCompiler.TargetPath = "PrecompiledWeb\Web Application\"
Release.AspNetCompiler.Updateable = "true"
Release.AspNetCompiler.ForceOverwrite = "true"
Release.AspNetCompiler.FixedNames = "false"
Release.AspNetCompiler.Debug = "False"
VWDPort = "51664"
EndProjectSection
EndProject
Global
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 1
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccTeamFoundationServer = server_teamprojectcollection
SccWebProject0 = true
SccProjectUniqueName0 = .
SccProjectName0 = .
SccAuxPath0 = server_teamprojectcollection
SccLocalPath0 = .
SccProvider0 = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
SccProjectEnlistmentChoice0 = 2
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{2D32A179-D771-4510-9C8B-D17D50BE3AAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2D32A179-D771-4510-9C8B-D17D50BE3AAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
`
Run Visual Studio as Administrator and then try opening the project. This happens for 2 reasons.
You are trying to open a project that you downloaded from online and the project file is marked as that.
You are trying to open a project that is a web application project and the project is set to use the local IIS.
It might well be that both apply to you.
If you downloaded a .zip file from the Interwebs, then before you unzip it, go into the file's properties and Unlock it, then unarchive it. This way Windows will not mark all files it contains as unsafe.
Update:
After reading your question in a bit more detail, I have done some research and I think the issue lies in the TFS settings contained in your solution file. They have somehow gone awry or gotten corrupted.
Try following the procedure described here to solve the issue. If that still doesn't work, then create a blank solution file and add the web application to the solution using existing source. You will find this under the File menu under the New menu item.

Resources