【发布时间】:2018-01-10 22:06:58
【问题描述】:
我的 Xamarin Android 项目引用了一个 .NetStandard 项目。 Android 项目中的断点工作正常,但在 .NetStandard 代码中却没有。有什么办法可以解决这个问题吗?
【问题讨论】:
标签: xamarin xamarin.android .net-standard
我的 Xamarin Android 项目引用了一个 .NetStandard 项目。 Android 项目中的断点工作正常,但在 .NetStandard 代码中却没有。有什么办法可以解决这个问题吗?
【问题讨论】:
标签: xamarin xamarin.android .net-standard
我相信 Xamarin 对 ppdb 的支持并不完全。因此,dotnet 标准 .csproj 中隐含的 <DebugType>portable</DebugType> 不兼容。
通过将以下内容添加到 dotnet 标准库的 .csproj 中,您应该能够在 dotnet 标准库中命中断点:
<DebugType>Full</DebugType>
这将回到默认调试类型“完整”而不是 ppdb(portable pdb)
如果需要条件,可以返回以下:
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>Full</DebugType>
</PropertyGroup>
或
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdb-only</DebugType>
</PropertyGroup>
不过<DebugType> 的发布有点多余。
【讨论】: