Как я должен использовать режим отладки/выпуска в Visual Studio?

Используйте path_to_theme функция.

7
задан Hertanto Lie 15 July 2009 в 01:04
поделиться

4 ответа

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.

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.

12
ответ дан 6 December 2019 в 07:27
поделиться

Я следую этому подходу:

  • цикл код / ​​отладка на моей рабочей станции: DEBUG
  • выполнение модульных тестов на моей рабочей станции: DEBUG
  • профилирование на моей рабочей станции: RELEASE
  • ночная сборка и автоматические тесты: RELEASE (выполняет автоматическую установку)
  • практическое тестирование командой QA: RELEASE

Все тесты должны проводиться, по крайней мере, на сборке выпуска, потому что это то, что вы собираетесь поставлять . Профилирование при отладочной сборке обычно бессмысленно (особенно в C ++), потому что отладочные кучи требуют множества дополнительных проверок, которые полностью меняют профиль производительности типичного приложения.

7
ответ дан 6 December 2019 в 07:27
поделиться

In general, ALWAYS deploy Release builds to production. Debug will add to your assembly weight and degrade performance.

If you are developing ASP.NET applications, leaving Debug mode on actually changes how/when your pages are compiled by the JIT compiler and significantly degrades performance to add better interactive debugging ability.

As far as which build to deploy to development...if you are running unit tests against development, it is probably a good idea to deploy the Debug build so you can get the most debugging information when tests fail or exceptions occur. However, there is hopefully an additional Testing or Pre-Production environment where you can have your integration tests running and manual tests are performed there. That Testing/Pre-Prod environment should DEFINITELY be using Release builds so that you can see the true perfomance and compilation issues before going to Production.

If you don't have this intermediate Testing/Pre-Prod level, then I would suggest running your Dev environment with Release. In other words, you should run at least one level before production in Release configuration.

For more information on what you can do with configurations, I have a blog post specifically for Silverlight (http://blog.tonyheupel.com/2009/04/environment-specific-service-references.html). In there is a link to Scott Hanselman's more generic article on build configurations and different environments.

3
ответ дан 6 December 2019 в 07:27
поделиться

По умолчанию сборка выпуска будет скомпилирована с большим количеством включенных оптимизаторов, что приведет к более быстрому и меньшему количеству кода, который обычно вы хотите выпустить для клиентов (отсюда и название). В

сборка отладки почти не оптимизируется, что означает, что при использовании отладчика базовый машинный код более точно соответствует исходному коду, что помогает при отладке. Кроме того, отладочная сборка по умолчанию включает дополнительные проверки кода времени выполнения, которые выявляют распространенные ошибки, такие как доступ к неитализированным элементам массива.

Обратите внимание, что вы можете создавать сборки выпуска с отладочными символами, отладчику просто становится труднее сопоставить текущий оператор в машинный код в соответствующую строку исходного кода.

2
ответ дан 6 December 2019 в 07:27
поделиться
Другие вопросы по тегам:

Похожие вопросы: