locked
PDB emitted at the same time as DLL doesn't match DLL (C++ Runtime component in C# StoreApp)

    Question

  • Hello,

    I have a C++ Windows Runtime component and a C# Store app using it. The component is referenced in C# Store app by referencing its project within the same solution. When debugging the Store app, I am unable to step into my C++ component because symbols aren't loaded. In call stack window, I right-click on functions residing in C++ component and choose Load Symbols. The dialog box displays the folder where DLL builds, already filtered to show *.pdb, and displays the PDB file right there. When I double-click it, it says no matching symbols found. The date/time stamp on DLL and PDB is the same as they were built at the same time by the same process.

    I tried clearing all PDBs and re-building to make sure none of them were locked and thus not updated, but that didn't help. Something else strange that happens is I get an intermittent error message about the PDB:

    LINK : fatal error LNK1209: program database "XXX.pdb" differs from previous link; relink or rebuild

    Why is the linker acting so weird, and why can it not do something as simple as create a PDB for the DLL?

    Thursday, July 3, 2014 8:54 PM

Answers

  • Both issues were caused by <ProgramDataBaseFileName> entries under each Platform/Configuration property group in VCXPROJ file containing their own value that conflicted with default value displayed in Visual Studio UI, which I guess was taken from the .props file (default property group template for C++ projects) included with Visual Studio. The global setting for ProgramDataBaseFileName was set to $(OutDir)\$(TargetName) and the private settings under each platform/Config property group were set to $(IntDir)\SpecificManuallyEnteredFileName.pdb. Thus there was also a conflict and PDBs were either going to both places, or physically going to one of the places but information encoded in DLL/PDB specified them to be in the other place. Something like that?

    I remember entering the SpecificManuallyEnteredFileName.pdb into Visual Studio UI, which is why it got set for every property group. However, why that setting didn't completely override the default global setting I have no clue, that seems to be undocumented functionality in MSBuild.

    Solution: delete any ProgramDataBaseFileName tags from VCXPROJ. Possibly attempt to set the PDB name again through UI, but I am not trying that. Got enough problems with MSBuild, so I am just letting it do what it wants now.


    Thursday, July 3, 2014 10:39 PM