I want to customise the sln file of my solution to manage:
- 3 projects
- 5 configurations: Debug, Production_total, Production_Partial, Release and Recette
Each configuration should use "Any CPU" platform.
I came to this:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32922.545
MinimumVisualStudioVersion = 10.0.40219.1
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Dumbow2", "Dumbow 2\Dumbow2.vbproj", "{101E24DB-EFB4-4375-A206-AC3FD4518FE7}"
ProjectSection(ProjectDependencies) = postProject
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3} = {9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}
EndProjectSection
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Dumbow2_update_version_reference", "Dumbow2_update_version_reference\Dumbow2_update_version_reference.vbproj", "{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}"
ProjectSection(ProjectDependencies) = postProject
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133} = {0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}
EndProjectSection
EndProject
Project("{778DAE3C-4631-46EA-AA77-85C1314464D9}") = "Dumbow2_prebuilt", "Dumbow2_prebuilt\Dumbow2_prebuilt.vbproj", "{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Production_Partial|Any CPU = Production_Partial|Any CPU
Production_Total|Any CPU = Production_Total|Any CPU
Release|Any CPU = Release|Any CPU
Recette|Any CPU = Recette|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Debug|Any CPU.ActiveCfg = Debug|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Debug|Any CPU.Build.0 = Debug|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Production_Total|Any CPU.ActiveCfg = Production_Total|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Production_Total|Any CPU.Build.0 = Production_Total|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Production_Partial|Any CPU.ActiveCfg = Production_Partial|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Production_Partial|Any CPU.Build.0 = Production_Partial|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Release|Any CPU.ActiveCfg = Release|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Release|Any CPU.Build.0 = Release|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Recette|Any CPU.ActiveCfg = Recette|x64
{101E24DB-EFB4-4375-A206-AC3FD4518FE7}.Recette|Any CPU.Build.0 = Recette|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Debug|Any CPU.ActiveCfg = Debug|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Debug|Any CPU.Build.0 = Debug|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Production_Total|Any CPU.ActiveCfg = Production_Total|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Production_Total|Any CPU.Build.0 = Production_Total|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Production_Partial|Any CPU.ActiveCfg = Production_Partial|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Production_Partial|Any CPU.Build.0 = Production_Partial|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Release|Any CPU.ActiveCfg = Release|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Release|Any CPU.Build.0 = Release|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Recette|Any CPU.ActiveCfg = Recette|x64
{9DD6A3BA-4177-477A-A4BF-DEC95B7984C3}.Recette|Any CPU.Build.0 = Recette|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Debug|Any CPU.ActiveCfg = Debug|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Debug|Any CPU.Build.0 = Debug|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Production_Total|Any CPU.ActiveCfg = Production_Total|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Production_Total|Any CPU.Build.0 = Production_Total|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Production_Partial|Any CPU.ActiveCfg = Production_Partial|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Production_Partial|Any CPU.Build.0 = Production_Partial|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Release|Any CPU.ActiveCfg = Release|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Release|Any CPU.Build.0 = Release|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Recette|Any CPU.ActiveCfg = Recette|x64
{0B3CCBC2-9BE8-4B03-9D91-86ED2474F133}.Recette|Any CPU.Build.0 = Recette|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {D8CF22E9-68E7-417A-8707-BAF2C4AC2391}
EndGlobalSection
EndGlobal
The solution loads in Visual Studio but I got "Current solution contains incorrect configuration mappings". Did the issue come from that "customised" SLN File or did it come from the fact there is some mismatches between the SLN files and the vbproj files of each project within the solution?
Last question: in Visual Studio UI, only two configuration display. I don't get why.
I am able to reproduce your situation:
There is a problem with your .sln file.
GlobalSection(ProjectConfigurationPlatforms)
section shows configuration mappings tox64
, while you intended to useAny CPU
.On my side it is:
Once I change to this:
The issue will disappear:
If you manually write the sln like original(map to x64), you should be able to reproduce the issue again.
As Jonathan said, please don't try to write the sln file manually, otherwise, there may be some unexpected errors.
You need to reopen the vs after changing manually and to tell the truth, the vs doesn't only consider your writing, it also considers the caches in other places, it will reformat after reload. I suggest you not write it, otherwise, it will make something unexpected.
But I can also reproduce this situation.
This is my sln file:
And the active configuration is not loaded:
If you really want to write and make it work, please don't copy&paste(it may contains unexpected bytes), write it manually one by one, it works on my side:
For example, I write the section 'Recette' like this:
And it works:
Remember to write one by one, otherwise the changes will be droped by VS immediately(I suspect you add them all in one time.).
Anyway, I strongly do not recommend that you write by hand. This may cause a lot of problems. Although you can handwrite some of the things you encounter now, please only take it as a try(to better understand it). Please remember that VS not only refers to your manually written sln file, but also Lots of other binaries, caches and stuff like that.