且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该如何在Visual Studio中使用调试/发布模式?

更新时间:2023-01-02 21:37:49

发布/发布应用程序时,应在发布"模式下进行.释放模式仅用于释放应用程序.生成的代码通常性能更高,并且许多代码会删除许多与应用程序开发阶段相关联的检查.

When releasing / publishing an application you should do so in Release mode. Release mode is for just that, releasing applications. The code produced is typically more performant and many removes many checks that are more associated with the development phase of an application.

通常,您应该在Debug模式下进行开发.大多数语言都会在调试模式的应用程序中插入额外的检查.这些漏洞更多,但往往会使应用程序变慢.

In a typical day, you should be developing in Debug mode. Most languages insert extra checks into a debug mode application. These spot more bugs but tend to slow down the application a bit.

但是,作为开发过程的一部分,您还必须对发布模式进行重大测试.客户实际上只会看到产品的发布模式版本,并且错误可能是特定于调试/发布模式的.以调试模式插入的错误检查会带来副作用,这些副作用会在您的应用程序中隐藏真正的错误.

Yet you must also do siginificant testing of Release mode as part of your development process. Customers will only actually see the Release mode version of your product and it's possible for bugs to be Debug / Release mode specific. The bug checks inserted in debug mode can introduce side effects that hide real bugs in your application.