PostSharp之后,pdb文件出现问题 [英] pdb file is mising after PostSharp
问题描述
我使用的是PostSharp 2.1.6.4版(也尝试使用最新的2.1.7.35版),有时缺少pdb文件,并且在该位置有一个pssym文件.
I am using PostSharp version 2.1.6.4 (also tried latest version 2.1.7.35) and sometimes pdb file is missing and there is a pssym file in it's place.
<?xml version="1.0" encoding="utf-8"?>
<Symbols xmlns="http://schemas.postsharp.org/2.0/symbols">
<Class Class="#1=T:[CrosscuttingLogging]CrosscuttingLogging.Attributes.LogMethodCallStatsAttribute" LimitedLicense="true" />
<Class Class="#2=T:[RequestLimiter]RequestLimiter.RequestCounterAttribute" LimitedLicense="true" />
</Symbols>
我在构建过程中执行了procmon,据我所知,postsharp.srv.4.0-x86.exe
过程将dll和pdb文件都从obj\Debug
文件夹移到了obj\Debug\Before-PostSharp
文件夹,随后又在obj\Debug
文件夹中生成了一个新的dll. ,但不会未生成新的pdb文件.
I ran procmon on the build process and as far as I can tell the postsharp.srv.4.0-x86.exe
process moves both dll and pdb files from obj\Debug
folder to obj\Debug\Before-PostSharp
folder and later on generates a new dll in obj\Debug
folder, but a new pdb file is not generated.
这种情况发生在我的某些dll(看似随机)上,似乎并不可靠,因为在其他计算机上,所有pdb文件都是正确生成的.
This happens for some of my dlls (seemingly at random) and does not seem to be reliable, because on other machine all pdb files are generated correctly.
推荐答案
PostSharp 2.1.x不支持Visual Studio 2015(.NET4.6/Roslyn).
PostSharp 2.1.x doesn't support Visual Studio 2015 (.NET4.6/Roslyn).
.NET 4.6中的PDB格式有所更改.我希望在PDB后处理过程中PostSharp中有一个异常,这就是为什么PDB没有复制到输出文件夹的原因.如果您使用的是VS2015,则可能会发生这种问题.
The PDB format has changed a little bit in .NET 4.6. I would expect that there is an exception in PostSharp during PDB post-processing which is the reason why the PDB is not copied to the output folder. If you are using VS2015, then this kind of issues could happen.
解决方案是不将.NET4.6/Roslyn与PostSharp 2.x一起使用,或者至少不升级到PostSharp 3.1.
The solution is either not to use .NET4.6/Roslyn with PostSharp 2.x or to upgrade to at least PostSharp 3.1.
这篇关于PostSharp之后,pdb文件出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!