Create multiple versions of a project in Visual Studio using Build Configurations

后端 未结 2 979
北恋
北恋 2020-12-18 05:47

I neeed to create multiple versions of my project using configuration just like we do with #define, #if, #endif.

The down side

2条回答
  •  一向
    一向 (楼主)
    2020-12-18 05:54

    In addition to Michael Freidgeim´s solution you can use attribute conditional for central initalisation operations or other void functions:

    [Conditional("DEVELOPMENT")]
    public static void InitDemo()
    {
          Models.LogFile.ErrorLog("This is a Development Version!");
          // init settings
    }
    

    Found here: http://msdn.microsoft.com/de-de/library/4xssyw96%28v=vs.80%29.aspx

提交回复
热议问题