Android 项目引用的 netstandard 项目中未命中断点

Breakpoints not getting hit in netstandard project referenced by Android project

我的 Xamarin Android 项目引用了 .NetStandard 项目。 Android 项目中的断点工作正常,但它们不在 .NetStandard 代码中。有什么解决方法可以解决这个问题吗?

我相信 Xamarin 不完全支持 ppdb。因此,dotnet 标准 .csproj 中隐含的 <DebugType>portable</DebugType> 不兼容。

通过将以下内容添加到 dotnet 标准库的 .csproj 中,您应该能够在 dotnet 标准库中设置断点:

<DebugType>Full</DebugType>

这将返回到默认调试类型 "full" 而不是 ppdb(便携式 pdb)

https://github.com/dotnet/core/blob/master/Documentation/diagnostics/portable_pdb.md#supported-scenarios

如果有条件需要,可以回到下面:

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <DebugType>Full</DebugType>
  </PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <DebugType>pdb-only</DebugType>
  </PropertyGroup>

然而发布 <DebugType> 有点多余。