Visual Studio: Cleanup and Restore with a Single Macro

I am trying to optimize my work with VS by creating several macros. I currently have the following macros:

Public Sub ReleaseBuild() DTE.ExecuteCommand("Build.SolutionConfigurations", "Release") DTE.ExecuteCommand("Build.RebuildSolution") End Sub Public Sub DebugBuild() DTE.ExecuteCommand("Build.SolutionConfigurations", "Debug") DTE.ExecuteCommand("Build.RebuildSolution") End Sub 

I want to clear the solution before rebuilding it. I have done this:

 Public Sub ReleaseBuild() DTE.ExecuteCommand("Build.SolutionConfigurations", "Release") DTE.ExecuteCommand("Build.CleanSolution") DTE.ExecuteCommand("Build.RebuildSolution") End Sub Public Sub DebugBuild() DTE.ExecuteCommand("Build.SolutionConfigurations", "Debug") DTE.ExecuteCommand("Build.CleanSolution") DTE.ExecuteCommand("Build.RebuildSolution") End Sub 

But I will get the error below:

alt text http://img23.imageshack.us/img23/2667/errorcb.png

I believe that cleanliness should be done first of all before restoration. I know that this can be done by running two separate macros, but I really want to achieve this with one click.

Regards,

Cyril

+4
source share
1 answer

Restore First Not CLEAN Solution

I know that from experience with a large number of projects and when I add a parameter to a method in one project and calling this method from a second project with the implementation of additional parameter recovery, I often get an error taking into account the number of parameters in this method!

using

 DTE.Solution.SolutionBuild.Clean(True) DTE.Solution.SolutionBuild.Build(True) 

not

 DTE.ExecuteCommand("Build.CleanSolution") DTE.ExecuteCommand("Build.RebuildSolution") 
+6
source

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


All Articles