【问题标题】:Generate PDB files when compilation debug="false" for ASP.NET files?为 ASP.NET 文件编译 debug="false" 时生成 PDB 文件?
【发布时间】:2010-04-15 05:25:18
【问题描述】:

我想设置编译 debug="false" 以从 aspx 文件中即时编译发布模式 dll。

但是,我仍然需要行号等错误,就像您在编译带有 pdbonly 集的 DLL 项目时发现的那样。

如果你想这样做,你可以在这个问题上找到一个很好的答案:Display lines number in Stack Trace for .NET assembly in Release mode

有什么想法吗?

【问题讨论】:

  • 这是 WSP(网站项目)还是 WAP(Web 应用程序项目)设置?

标签: asp.net release pdb-files


【解决方案1】:

也许你可以在 web.config 上的编译器上做到这一点

我这里有 Trace 命令,你可以设置任何编译器选项

<system.codedom>
 <compilers>
 <compiler language="c#;cs;csharp" extension=".cs" compilerOptions="/define:TRACE" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
 <providerOption name="CompilerVersion" value="v3.5"/>
 <providerOption name="WarnAsError" value="false"/>
</compiler>
<Compilers>

您可以使用的编译器选项 http://msdn.microsoft.com/en-us/library/6ds95cz0(VS.71).aspx

【讨论】:

  • 我认为做到了!谢谢阿里斯托斯。
  • 仅供参考,我添加到 compilerOptions="/debug:pdbonly"
  • @CubanX 感谢分享:)
猜你喜欢
  • 2012-09-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-07-24
  • 2010-09-13
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多