简体   繁体   English

DLL在GAC中时(生产中),PDB和.NET Framework调试控制ini文件

[英]PDBs and .NET Framework Debugging Control ini files when DLLs are in the GAC (in Production)

For various reasons all our components are deployed in the GAC, both in the client (winforms) and server (hosted by a WCF windows service) machines. 由于各种原因,我们的所有组件都部署在GAC中,包括客户端(winforms)和服务器(由WCF Windows服务托管)计算机。 We use VIsual Studio 2013 / .Net 4.5.1 我们使用VIsual Studio 2013 / .Net 4.5.1

We were not deploying or storing PDBs anywhere which I know is a mistake. 我们没有在我知道是错误的地方部署或存储PDB。 We are now looking into correcting this, so to improve our exception traceability and debugging purposes we are: 我们现在正在研究纠正此问题,因此,为了提高我们的异常可追溯性和调试目的,我们是:

  • Generating PDBs with pdbonly and optimize true in our msbuild process, and storing them safely, not sure yet if we will use a symbol server or we will just store it with the binaries. 使用pdbonly生成PDB并在msbuild流程中优化true,然后安全地存储它们,尚不确定是否要使用符号服务器,还是将其与二进制文件一起存储。

  • Deploying the DLLs AND the pdbs to production in the GAC (C:\\Windows\\Microsoft.NET\\assembly\\GAC_32...), this is to get line numbers in stack traces. 将DLL和pdbs部署到GAC(C:\\ Windows \\ Microsoft.NET \\ assembly \\ GAC_32 ...)中的生产环境中,这是为了在堆栈跟踪中获取行号。 Not sure if this is worthy as the optimizations usually change the line numbers anyway. 不确定是否值得,因为优化通常会更改行号。 If anyone has any comments about this then great, but at the moment we have very long methods and not having a clue about the line number consumes time :-) 如果有人对此有任何评论,那就太好了,但是目前我们有很长的方法,而且不知道行号会浪费时间:-)

  • We also deploy some powershell scripts to generate INI files to disable/enable optimization if required as described here . 如果所描述的要求我们还部署了一些PowerShell脚本生成INI文件来禁用/启用优化这里 So the plan is that if our client finds an error then we can turn optimization off and get correct line numbers if needed. 因此计划是,如果我们的客户发现错误,那么我们可以关闭优化并在需要时获取正确的行号。

  • In addition to this using ProcDump we instruct our clients to generate a minidump whenever they get an exception difficult to reproduce in development with procdump -e 1 XXXX 除了使用ProcDump进行此操作外,我们还指示客户每当遇到难于使用procdump -e 1 XXXX在开发中重现的异常时生成一个小型转储。

My question: 我的问题:

I know copying the PDBs and the INI files in the same folders where the DLLs are (in the GAC) doesn't look right. 我知道在DLL所在的相同文件夹中(在GAC中)复制PDB和INI文件看起来不正确。 So... where can we put these then? 那么...那我们可以放在哪里呢? I havent been able to find any solutions so the PDBs and INI files are picked up in production. 我还没有找到任何解决方案,因此在生产中无法使用PDB和INI文件。

I have posted this in a MS forum as well, if anyone answers I will add cross references... but I have been searching for a few hours and haven't found any information...! 我也将其发布在MS论坛上,如果有人回答,我会添加交叉引用...但是我已经搜索了几个小时,却没有找到任何信息...!

After consulting people at Microsoft it looks like we were doing the right thing, ie Putting the pdb and ini files in the gac folders is correct. 在咨询了Microsoft的人员之后,看来我们在做正确的事情,即将pdb和ini文件放入gac文件夹中是正确的。

Also FYI the pdb is loaded (Ie Performance penalty) whenever the exception.stacktrace is used. 此外,每当使用exception.stacktrace时,就会加载pdb(即性能损失)。

Hope it helps! 希望能帮助到你!

Source: http://blogs.msdn.com/b/visualstudioalm/archive/2015/08/14/debugging-optimized-code.aspx (See comments at the bottom of the article) 来源: http//blogs.msdn.com/b/visualstudioalm/archive/2015/08/14/debugging-optimized-code.aspx (请参阅文章底部的评论)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM