Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pdb file is mising after PostSharp

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.

like image 357
Aleksei Poliakov Avatar asked Jun 25 '15 18:06

Aleksei Poliakov


People also ask

How do I debug a PDB file?

The easiest way to use the PDB file is to let Visual Studio do the heavy lifting - either launch your program with Visual Studio's "Debug" command (F5 by default), or run the program and use the "Attach to Process" item in Visual Studio's Debug menu.

Does PDB file need to be deployed?

No, you don't have to deploy the . pdb file. To quote from MSDN, "A PDB file is created when you build with /debug (Visual Basic/C#).", so it shouldn't be creating the debug database when compiling for release.

What is PDB file with DLL?

Program database (PDB) is a file format (developed by Microsoft) for storing debugging information about a program (or, commonly, program modules such as a DLL or EXE). PDB files commonly have a . pdb extension. A PDB file is typically created from source files during compilation.

Where do PDB files go?

pdb file stores all debug information for the project's .exe file, and resides in the \debug subdirectory. The <project>. pdb file contains full debug information, including function prototypes, not just the type information found in VC<x>. pdb.


2 Answers

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.

like image 169
Jakub Linhart Avatar answered Sep 30 '22 10:09

Jakub Linhart


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.

like image 42
Wes Shaddix Avatar answered Sep 30 '22 10:09

Wes Shaddix