Asp.Net生产中的调试设置

时间:2018-12-12 13:00:36

标签: c# asp.net asp.net-mvc visual-studio

我已经在debug=false中设置了Web.config用于生产,但是我想在日志中查看异常行号,所以我必须执行以下操作:

  • 取消选中Optimize code
  • 取消选中Exclude generated debug symbols
  • 将调试信息设置为Pdb-only

我的问题是,这样做会导致我失去一些表现吗?是否建议在生产环境中这样做?

1 个答案:

答案 0 :(得分:0)

来自https://docs.microsoft.com/en-us/visualstudio/debugger/how-to-enable-debugging-for-aspnet-applications?view=vs-2017

Important

Debug mode greatly reduces the performance of your app. For best performance, set debug="false" in the web.config and specify a Release build when you deploy a production app or conduct performance measurements.