PDBs fail to generate when referencing netstandard project from UWP app
See original GitHub issueSteps to reproduce
- Create a solution with a UWP app and netstandard library using VS2017 RTW.
- Reference the library from the UWP app.
- Build an appx package in debug mode, or build an appxupload package, including symbol packages.
Results
The pdb files aren’t generated for the debug build or the appxupload. Release builds generate pdb files without apparent issue. Pdb files aren’t included in the appxupload package, even though the build succeeds.
This does not happen when referencing a PCL.
Update: MSBuild 15.1 gives the error Failed to convert FastLink symbols to full PDBs for '....pdb' due to failure to find the tool '\mspdbcmf.exe'.
Here is the diagnostic output from the msbuild task:
Target "_GenerateAppxSymbolPackage: (TargetId:237)" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets" from project "C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\App1.csproj" (target "_CreateAppxBundlePlatformSpecificArtifacts" depends on it):
Building target "_GenerateAppxSymbolPackage" completely.
Output file "C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\AppPackages\App1_1.1.7.0_Debug_Test\App1_1.1.7.0_x86_Debug.appxsym" does not exist.
Set Property: StripPrivateSymbols=false
Set Property: ReconstituteFastlinkPdbs=true
Set Property: MsPdbCmfExeFullpath=\mspdbcmf.exe
Using "GenerateAppxSymbolPackage" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.Build.AppxPackage.dll".
Task "GenerateAppxSymbolPackage" (TaskId:488)
Task Parameter:PdbCopyExeFullPath=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\PDBCopy.exe (TaskId:488)
Task Parameter:MsPdbCmfExeFullpath=\mspdbcmf.exe (TaskId:488)
Task Parameter:
PdbFiles=
C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\bin\x86\Debug\App1.pdb
OutputGroup=DebugSymbolsProjectOutputGroup
ProjectName=App1
TargetPath=App1.pdb
C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\bin\Debug\netstandard1.4\ClassLibrary1.pdb
BuildReference=true
CopyLocal=true
FusionName=
MSBuildSourceProjectFile=C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\ClassLibrary1.csproj
MSBuildSourceTargetName=Build
Name=ClassLibrary1
OriginalItemSpec=C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\bin\Debug\netstandard1.4\ClassLibrary1.dll
OriginalProjectReferenceItemSpec=..\ClassLibrary1\ClassLibrary1.csproj
OutputGroup=CopyLocalFilesOutputGroup
OutputItemType=
Project={265dbec3-4830-48b8-88cc-6965bd5fec75}
ProjectName=App1
ReferenceOutputAssembly=true
ReferenceSourceTarget=ProjectReference
ResolvedFrom=C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\bin\Debug\netstandard1.4\ClassLibrary1.dll
SetTargetFramework=TargetFramework=netstandard1.4;ProjectHasSingleTargetFramework=false;ProjectIsRidAgnostic=true
TargetPath=ClassLibrary1.pdb
Targets=
UndefineProperties=;ProjectHasSingleTargetFramework;RuntimeIdentifier;ProjectIsRidAgnostic
Version= (TaskId:488)
Task Parameter:ProjectName=App1 (TaskId:488)
Task Parameter:StrippedDirectory=obj\x86\Debug\Stripped (TaskId:488)
Task Parameter:StripPrivateSymbols=False (TaskId:488)
Task Parameter:ReconstituteFastlinkPdbs=True (TaskId:488)
Task Parameter:AppxSymbolPackageOutput=C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\AppPackages\App1_1.1.7.0_Debug_Test\App1_1.1.7.0_x86_Debug.appxsym (TaskId:488)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\PDBCopy.exe "C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\bin\x86\Debug\App1.pdb" obj\x86\Debug\Stripped\App1.pdb (TaskId:488)
Stripping private symbols from 'C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\bin\x86\Debug\App1.pdb'. (TaskId:488)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\PDBCopy.exe "C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\bin\Debug\netstandard1.4\ClassLibrary1.pdb" obj\x86\Debug\Stripped\ClassLibrary1.pdb (TaskId:488)
Can't open pdb file C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\ClassLibrary1\bin\Debug\netstandard1.4\ClassLibrary1.pdb (TaskId:488)
STRIPPRIVATESYMBOLS : error : EC_FILE_SYSTEM [C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\App1.csproj]
The command exited with code 3. (TaskId:488)
C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2670,5): error APPX0502: File '\mspdbcmf.exe' not found. [C:\Users\Develop\Documents\Visual Studio 2017\Projects\App1\App1\App1.csproj]
Done executing task "GenerateAppxSymbolPackage". (TaskId:488)
Workaround
In the .NET Standard project, set the DebugType
to pdbonly
e.g.:
<PropertyGroup>
<DebugType>pdbonly</DebugType>
</PropertyGroup>
Or in the GUI, Project properties -> Build -> Advanced -> Debugging Information -> pdb-only
Issue also filed here.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:11
- Comments:38 (19 by maintainers)
Top Results From Across the Web
Can't Debug .NET Standard 2.0 DLL in UWP
NET Standard 2.0 assemblies in UWP. Apparently there is a new type of PDB that is generated in .NET Standard 2.0 projects.
Read more >MSBuild reference for .NET SDK projects
When this property is set to true , all symbol files (also known as PDB files) from PackageReference items in the project are...
Read more >NET SDK error list - .NET CLI
Run a NuGet package restore to generate this file. ... This can indicate a missing project reference. ... NET Standard 1.5 or higher....
Read more >mspdbcmf.exe 14.11.25506.0 fails to convert partial PDB's
The PDB conversion tool appears to be broken as of the VS 2017 15.3 & 15.3.1 updates. Just creating a default C++ console...
Read more >[UWP][ARM][.Net] VS2019 fails building project generated ...
I generate a project ("build" button) but trying to build that in VS2019 fails. Even for an empty project with just TextMesh Pro...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I ended up changing the project file by hand to:
This seems to work
FYI I have just created an internal bug tracking the issue that is now being triaged on the VS team.