Missing configuration settings in configuration manager

I often create custom assembly configurations in my Configuration Manager solution. When I include previously created projects in the solution, they do not automatically include these new configurations. The only way I found to populate these projects with the appropriate configuration settings is to manually edit the project file.

Is there a way to force all projects in a solution for all to use the same set of Configuration Manager configurations?

+6
source share
4 answers

I found that deleting all configurations and adding them back again fixes all projects in the solution

+13
source

VS2010 "The export template wizard will work for this situation. You will need to create a project and configure all your settings, files, etc. Then export it as a template. When you start a new project, you can select your new template, and settings will be migrated to Configuration Manager. I created a simple test project and it worked. It will not take into account any projects that you have already created.

This DevGuy blog post has a walkthrough with photos in progress.

+3
source

I had the same problem and this is how I fixed it.

First close Visual Studio and find the project guide from the new projects. This can be done by looking at the .csproj file. Then open the solution file in a text editor such as Notepad ++.

In the solution file, find the GlobalSection(ProjectConfigurationPlatforms) = postSolution .

Each of your projects will have a configuration list. You will notice that your new projects probably already have settings for your configurations, BUT they will be set to DEBUG or RELEASE , as shown in the example below.

 {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.ActiveCfg = Debug|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.Build.0 = Debug|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.ActiveCfg = Debug|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.Build.0 = Debug|Any CPU 

To fix this, modify Debug|Any CPU instead of your configuration. Therefore, in my example above, my settings will be as follows:

 {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.ActiveCfg = Staging|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Staging|Any CPU.Build.0 = Staging|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.ActiveCfg = Live|Any CPU {2E6B7D61-640E-4878-BE6D-7CD705AB9A6A}.Live|Any CPU.Build.0 = Live|Any CPU 

Save the changes, and then restart Visual Studio and open your solution.

+2
source

You can write a Visual Studio macro that does this for you. Bind it to the menu button, and you can add these configurations to the project with one click.

0
source

Source: https://habr.com/ru/post/900566/


All Articles