【问题标题】:Breakpoints not getting hit in netstandard project referenced by Android projectAndroid 项目引用的 netstandard 项目中未命中断点
【发布时间】:2018-01-10 22:06:58
【问题描述】:

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

【问题讨论】:

    标签: xamarin xamarin.android .net-standard


    【解决方案1】:

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

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

    <DebugType>Full</DebugType>
    

    这将回到默认调试类型“完整”而不是 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>
    

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

    不过&lt;DebugType&gt; 的发布有点多余。

    【讨论】:

      猜你喜欢
      • 2018-05-06
      • 1970-01-01
      • 2018-06-01
      • 2017-11-02
      • 1970-01-01
      • 2017-09-15
      • 1970-01-01
      • 1970-01-01
      • 2018-01-23
      相关资源
      最近更新 更多