共用方式為


適用於 Android 的 .NET 警告 XA0125

範例訊息

warning XA0125: 'AndroidApp1.pdb' is using a deprecated debug
information level. Set the debugging information to Portable in the
Visual Studio project property pages or edit the project file in a
text editor and set the 'DebugType' MSBuild property to 'portable' to
use the newer, cross-platform debug information level. If this file
comes from a NuGet package, update to a newer version of the NuGet
package or notify the library author.

問題

支援以將 DebugType MSBuild 屬性設定為 fullpdbonly 所建置的 .mdb.pdb 符號檔案現已不建議使用。 這適用於應用程式專案及參考連結庫中的 .mdb.pdb 檔案,包括 NuGet 套件。

解決方法

在應用程式專案中以及所有連結庫參考中設定 DebugTypeportableportable 是現在起所有項目的建議設定。 較舊的 fullpdbonly 設定適用於較舊的 Windows 特定檔案格式。 .NET 6 和更新版本不支持這些較舊的格式。

在 Visual Studio 中,移至專案屬性頁中的 屬性 > 建置 > 進階,並將 偵錯資訊 變更為 可攜式

在 Visual Studio for Mac 中,移至專案屬性頁中的 [建置 > 編譯器 > 偵錯資訊],並將 [偵錯資訊] 變更為 [可攜式]

如果有問題的符號檔來自 NuGet 套件,請更新為較新版本的套件,或通知連結庫作者。