Warning when building with wrong configuration

user1338871

After a few mistake builds with the Release configuration pushing stuff to other environments I'd like to have a warning or prompt of some sort to stop me from doing such madness if I don't really want to.

Is there a way to make this happen? :)

BarrieK

The simplest way that I can see of doing this is to leverage the Build Events dialog in the Project Settings.

First add a file called usermessage.vbs to the solution. It should contain the following:

a = MsgBox("Continue with Debug Build",1,"Build Configuration Warning")
if a=1 then WScript.Quit(0) Else WScript.Quit(1) End If

This will present an OK/Cancel dialog which returns an error unless you click OK.

Add this code to the Pre-build event command line:

if $(ConfigurationName) == Debug WSCRIPT.EXE "$(SolutionDir)usermessage.vbs"

This will run the script if you build in debug configuration. The script will error and the build will halt unless you click OK in the dialog.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

R: Warning when building a package

From Dev

R: Warning when building a package

From Dev

WebGrease warning when building a deployment package

From Dev

WebGrease warning when building a deployment package

From Dev

VCTargetsPath is wrong when building with MSBuild on build server

From Dev

Warning CS1702 when using Microsoft Identity and building solution

From Dev

Warning CS1702 when using Microsoft Identity and building solution

From Dev

Need to get error/warning when building a PL/SQL package with Ant

From Dev

Unity trying to load wrong namespace when building for WSA

From Dev

Throw an error/warning when supplying wrong argument type to C function

From Dev

Throw an error/warning when supplying wrong argument type to C function

From Dev

Error:Configuration with name 'default' not found when building for Sony Smart Glass

From Dev

Use a configuration file from the host when building a Docker image

From Dev

mvn checkstyle:checkstyle uses wrong configuration when using reporting

From Dev

Warning : configuration file not found

From Dev

error "class file has wrong version 55.0, should be 52.0" when building Alfresco

From Dev

Java: Compiler or Eclipse warning when attempting to use wrong type as Map key

From Dev

How to avoid warning when i use wrong password and email in login form of imap authorization?

From Dev

What configuration and platform does msbuild use by default when building a solution file or project files

From Dev

Unrecognized configuration section "microsoft.applicationServer" when trying to build from command line or building a deployment package

From Dev

How can I specify a custom linker configuration for Xamarin.iOS when building from Visual Studio 2015?

From Dev

"The specified solution configuration "Debug|AnyCPU" is not valid" error when building solution via Microsoft.Build

From Dev

Wrong format warning in this c program

From Dev

Class not found in module warning when try to create Run/Debug Configuration in Intellij

From Dev

Prefix - something wrong in configuration

From Dev

Wrong nginx or dns configuration?

From Dev

Wrong symfony configuration

From Dev

Getting java.net.ConnectException: your endpoint configuration is wrong when running ./yarn command

From Dev

IndexNotReadyException when building the application

Related Related

  1. 1

    R: Warning when building a package

  2. 2

    R: Warning when building a package

  3. 3

    WebGrease warning when building a deployment package

  4. 4

    WebGrease warning when building a deployment package

  5. 5

    VCTargetsPath is wrong when building with MSBuild on build server

  6. 6

    Warning CS1702 when using Microsoft Identity and building solution

  7. 7

    Warning CS1702 when using Microsoft Identity and building solution

  8. 8

    Need to get error/warning when building a PL/SQL package with Ant

  9. 9

    Unity trying to load wrong namespace when building for WSA

  10. 10

    Throw an error/warning when supplying wrong argument type to C function

  11. 11

    Throw an error/warning when supplying wrong argument type to C function

  12. 12

    Error:Configuration with name 'default' not found when building for Sony Smart Glass

  13. 13

    Use a configuration file from the host when building a Docker image

  14. 14

    mvn checkstyle:checkstyle uses wrong configuration when using reporting

  15. 15

    Warning : configuration file not found

  16. 16

    error "class file has wrong version 55.0, should be 52.0" when building Alfresco

  17. 17

    Java: Compiler or Eclipse warning when attempting to use wrong type as Map key

  18. 18

    How to avoid warning when i use wrong password and email in login form of imap authorization?

  19. 19

    What configuration and platform does msbuild use by default when building a solution file or project files

  20. 20

    Unrecognized configuration section "microsoft.applicationServer" when trying to build from command line or building a deployment package

  21. 21

    How can I specify a custom linker configuration for Xamarin.iOS when building from Visual Studio 2015?

  22. 22

    "The specified solution configuration "Debug|AnyCPU" is not valid" error when building solution via Microsoft.Build

  23. 23

    Wrong format warning in this c program

  24. 24

    Class not found in module warning when try to create Run/Debug Configuration in Intellij

  25. 25

    Prefix - something wrong in configuration

  26. 26

    Wrong nginx or dns configuration?

  27. 27

    Wrong symfony configuration

  28. 28

    Getting java.net.ConnectException: your endpoint configuration is wrong when running ./yarn command

  29. 29

    IndexNotReadyException when building the application

HotTag

Archive