locked
Problem setting the current configuration/platform RRS feed

  • Question

  • hi.

    i have a vs (2013) package that contains a single command. The command is supposed to change the current solution configuration as well as the current startup project. (infact, the command toggle between two configuration/startup tuples.)

    The code to the command looks like this:

      private void ToggleDebugTesterCallback(object sender, EventArgs e)
      {
       var dte2 = (DTE2) Marshal.GetActiveObject("VisualStudio.DTE.12.0");

       SolutionConfiguration s = dte2.Solution.SolutionBuild.ActiveConfiguration;
       if (s.Name == "Debug Tester")
       {
        var config = dte2.Solution.SolutionBuild.SolutionConfigurations.Item("Debug Native Tester");
        if (config != null)
        {
         config.Activate();
         dte2.Solution.Properties.Item("StartupProject").Value = "kernel.native.tester";
        }
       }
       else
       {
        // activate the other config/startup tuple here
       }
      }

    And basically, that works. However, after the command has run, not only the current solution configuration has changed, that current SolutionPlatform has changed also. (i.e.: I have several platforms, "win32", "win64", "mixedPlatform"..., and before the command is run, "MixedPlatforms" is the "current" platform. After the command is run, "Win32" is the current platform. )

    Also, after the command has run, the "run in debugger" command appears to have changed. Before the command is run, there is the "usual" green arrow and the label says "Start". After the command has run, the label says "Local Windows Debugger". (I assume this is a side-effect of the platform change, but wanted to provide that info incase it helps finding a solution...)

    So the question is: How do I change the solution configuration without changing the solution platform ?

    WM_THXADVANCE
    -thomas woelfer


    http://www.die.de/blog

    Thursday, February 6, 2014 4:53 PM

Answers

All replies