sdk: PDBs fail to generate when referencing netstandard project from UWP app
Steps 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.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 11
- Comments: 38 (19 by maintainers)
Commits related to this issue
- Merge pull request #102 from wes566/master generate full PDBs so UWP projects can consume This looks good 👍 Ref: Work around for the bug https://github.com/dotnet/sdk/issues/955#issuecomment-... — committed to jamesmontemagno/ConnectivityPlugin by prashantvc 7 years ago
- workaround dotnet/sdk#955 — committed to dansiegel/Prism by dansiegel 7 years ago
- Log test output for flaky tests (#955) — committed to mmitche/sdk by ajaybhargavb 5 years ago
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.
I am currently not able to debug with .NET Standard 2.0 on UWP. It’s not all solutions, but one particular solution I cannot get working. In my case, I am seeing the PDB files. I have logged the issue here: https://github.com/dotnet/standard/issues/621 . I wonder if there are still general issues with Visual Studio debugging .NET Standard dlls on UWP…
I am using Visual Studio 15.5.3
Just for completeness:
Try using “pdb only” instead of “portable” in the .NET Standard library symbol generation settings.
/cc @tommcdon
I realize this is an older thread but I would like to add a “me too” to this: I have created a brand new UWP project as part of a Xamarin.Forms application. I am unable to set any breakpoints in code that I have written.
Breakpoints are disabled with the message that “No symbols have been loaded…”
Here is some of my version info…
Microsoft Visual Studio Enterprise 2017 Version 15.7.1 VisualStudio.15.Release/15.7.1+27703.2000 Microsoft .NET Framework Version 4.7.02556 . . . Xamarin 4.10.0.442 (396b18cef) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 4.12.264 (fc37cd02e) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin.Android SDK 8.3.0.19 (HEAD/342b2ce96) Xamarin.Android Reference Assemblies and MSBuild support.
Xamarin.iOS and Xamarin.Mac SDK 11.10.1.177 (7e782c1) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.
@trylek since you’ve confirmed this bug still exists can you re-open this issue? Thanks!
@wpeter-sfdc Understood, but shouldn’t the various declarations of it being “fixed” (links above, and the .NET Native 1.7 release notes supporting portable PDBs) mean the workaround isn’t necessary?
In project settings, build->advanced if not mistaking (sorry, writing from a phone)