none
How to rename "debug" and "release" to another name like "Debugstatic" something when I using a new custom wizard

    Question

  • Hi All

    I use Visual Studio c++ 2005 and I'm making a new custom wizard, but I face a 1 issue.

    When user make a new project using custom wiard made by me, I want to rename "Debug" and "Release" to "DebugStatic" and "ReleaseStatic" like something at Configuration manager part. But I can't find the solution.

    What I want to make is the custom wizard project and I want to use another name instead of "debug" and "release" in the project.

    In order to make sure, I explain again more.

    1. I made a new custom wizard project and I will rename the debug and release name to another name like "DebugStatic" something.
    2. After making the new custom wizard, I make a new project using the new custom wizard that I made.
    3. In this new project, I can set the configuration as Debug or Release. But because of renaming "Debug" and "Release" to "DebugStatic" and "ReleaseStatic", it will be shown as DebugStatic and ReleaseStatic, not just Debug and Release.

    It's what I want to do.


    Please let me know how to show those name.

    Thank you.
    • Edited by KevinKim Monday, May 18, 2009 8:53 AM
    Monday, May 18, 2009 12:15 AM

Answers

All replies

  • Hi Kevin,

    There are two types of configuration in Visual Studio, they are: Solution Configuration and Project Configuration, but the "Name" properties of them are "read-only".  So we cannot modify them directly, we should add a new configuration("DebugStatic") base on the existing one("Debug"), and then remove the "Debug" configuration.  I wrote an example to rename these two types of configuration as following:
    try
    {
        // Modify the solution configuration name
        Solution2 sol = _applicationObject.Solution as Solution2;
        SolutionConfigurations sc = sol.SolutionBuild.SolutionConfigurations;
        if (sc.Item("Debug") != null)
        {
            sc.Add("DebugStatic", "Debug", true);
            sc.Item("Debug").Delete();
        }
        // Modify the project configuration name
        ConfigurationManager cm = sol.Projects.Item(1).ConfigurationManager;
        if (cm.ConfigurationRow("Debug") != null)
        {
            cm.AddConfigurationRow("DebugStatic", "Debug", true);
            cm.DeleteConfigurationRow("Debug");
        }
    }
    catch (Exception e)
    {
        System.Windows.Forms.MessageBox.Show(e.Message);
    }

    For a better understanding of Solution and Project configurations, you could see our MVP--Carlos's posts:

    The convoluted build configuration automation model (EnvDTE/EnvDTE80)
    http://msmvps.com/blogs/carlosq/archive/2008/08/29/the-convoluted-build-configuration-of-the-automation-model-envdte-envdte80.aspx

    The diagram of the convoluted build configuration automation model (EnvDTE/EnvDTE80) (Part 2)
    http://msmvps.com/blogs/carlosq/archive/2008/09/01/the-fiagram-of-convoluted-build-configuration-automation-model-envdte-envdte80.aspx

    More on the build configuration automation model
    http://msmvps.com/blogs/carlosq/archive/2008/10/06/more-on-the-build-configuration-automation-model.aspx

    If anything unclear, please feel free to let me know.

    Sincerely,
    Wesley
    Please mark the replies as answers if they help and unmark them if they provide no help. Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Wesley Yao Friday, May 22, 2009 2:35 AM
    Tuesday, May 19, 2009 3:47 AM
  • Hi Wesley.

    Thanks you for your answer. :-)
    It's great helpful information.

    Thank you again :-)
    Wednesday, May 20, 2009 12:23 AM
  • Hi,

    In Visual Studio 2010, the DeleteConfigurationRow method always fails with the following error:

    An exception of type 'System.ArgumentNullException' occurred in VBAssembly but was not handled in user code
    Additional information: Parameter "condition" cannot be null.

    I'm calling it from a macro in Visual Studio...

    AddConfigurationRow works though...

    Any idea what's wrong?

    I need to batch-delete some renegade project configurations (I only know which configurations I'm NOT supposed to delete) in some ~ 200 projects in the same solution, and using macros is the fastest way I could think of. Does anyone know a better way?

    Thanks.

    Found a solution to this problem: https://connect.microsoft.com/VisualStudio/feedback/details/605491/configurationmanager-deleteconfigurationrow-method-broken-in-vs-2010
    • Edited by okfsadfga Wednesday, September 29, 2010 8:50 AM found solution
    Friday, September 24, 2010 3:09 PM