9

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>

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.

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.

Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
Aleksei Poliakov
  • 1,322
  • 1
  • 14
  • 27

3 Answers3

17

PostSharp 2.1.x doesn't support Visual Studio 2015 (.NET4.6/Roslyn).

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.

The solution is either not to use .NET4.6/Roslyn with PostSharp 2.x or to upgrade to at least PostSharp 3.1.

Jakub Linhart
  • 4,062
  • 1
  • 26
  • 42
  • 2
    Still had this issue with PostSharp 3.1; upgraded to the latest release (which is 4.1.x) which fixed the issue. In my case, it´s a .NET 4.5 solution which I migrated to Visual Studio 2015... I am not using .NET 4.6 yet. – Matze Jul 14 '15 at 13:08
  • i have postsharp 4.2 and still getting this. Unknown custom metadata item kind: 6. – klaudyuxxx Dec 21 '15 at 12:40
  • Which 4.2 version do you use? Are both PostSharp nuget package and PostSharp Tools for Visual Studio on 4.2 version? – Jakub Linhart Dec 22 '15 at 20:48
  • We have the same problem with VS2015 update 3, .NET 4.5.2 and Postsharp 2.1. (VS2015 Update 1 works) – pauloya Sep 28 '16 at 11:00
  • It's not a problem of 4.6. The issue takes place for any target framework in all VS starting 2015. So if your project had PostSharp 2.x then you (as me) have to stick to VS2013 forever. This is terrible. And this is why I won't use PostSharp again ever. – Shrike Mar 09 '17 at 15:05
  • This case is explained at http://support.sharpcrafters.com/discussions/problems/3849-postsharp-2x-and-vs20152017. – Antonín Procházka Mar 10 '17 at 16:25
  • The issue is even occurring in PostSharp v5.0.44 on Visual Studio 2017 (v15.7.3) – Mohammad S. Jun 06 '18 at 07:32
6

I had this same issue and I upgraded from PostSharp 3.1.46 to 3.1.67 and it did resolve my case. I do get the .pdb file created and I am able to debug again.

1

Same problem, same workaround. Upgraded from 3.1.51 to 3.1.69 and pdb generated again.

user306080
  • 1,409
  • 3
  • 16
  • 37