在Android项目引用的netstandard项目中,断点没有受到影响

xle*_*eon 3 xamarin.android xamarin .net-standard

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

Jon*_*las 7

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

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

<DebugType>Full</DebugType>
Run Code Online (Sandbox Code Playgroud)

这将返回到默认调试类型"full"而不是ppdb(portable 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>
Run Code Online (Sandbox Code Playgroud)

要么

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

然而,释放<DebugType>有点多余.