How to check if an assembly was built using Debug or Release configuration?

后端 未结 6 411
半阙折子戏
半阙折子戏 2020-12-13 04:16

I\'m starting deployment of my web application and I need to guarantee that all the assemblies that are going to be deployed were built using Release configuration. Our syst

6条回答
  •  不思量自难忘°
    2020-12-13 04:49

    I loved that David suggestion, but you could also go this way (AssemblyInfo.cs):

    #if DEBUG
    [assembly: AssemblyDescription("Your application assembly (DEBUG version)")]
    #else if RELEASE
    [assembly: AssemblyDescription("Your application assembly (RELEASE version)")]
    #endif
    

    This is more human friendly, as anyone can right-click that assembly, to select Properties and go to Details tab.

提交回复
热议问题