Can't Debug .NET Standard 2.0 DLL in UWP

谁说我不能喝 提交于 2019-12-05 04:26:49

It turns out that there are still issues with debugging .NET Standard 2.0 assemblies in UWP. Apparently there is a new type of PDB that is generated in .NET Standard 2.0 projects. This is related to this bug which has a workaround:

https://github.com/dotnet/sdk/issues/955

It's just a matter of editing the .NET Standard 2.0 project like so:

<PropertyGroup>
    <DebugType>pdbonly</DebugType>
</PropertyGroup>

This switches to old school PDBs and will slow down debugging, but until MSBuild etc. catches up, it's the only way to solve the problem from what I can see.

Edit: Microsoft claim that the original bug is now fixed in the latest version of Visual Studio, but I have not confirmed this: https://github.com/Microsoft/UWPCommunityToolkit/issues/1951

Some people are still experiencing this issue - even people at Microsoft, so I don't know the status of this at the moment.

alternative solution to accepted solution, you use also below lines. it tells that use full debugging, symbols included only for debug mode. I am not sure if Melbourne developers answer is affecting release mode, just to ensure.

 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
    <DebugType>full</DebugType>
    <DebugSymbols>true</DebugSymbols>
  </PropertyGroup>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!