【发布时间】:2020-02-08 22:45:43
【问题描述】:
在我的用于 UWP、Android 和 iOS(暂时卸载)的 Xamarin.Forms 应用程序中,我添加了以下代码:
StorageFolder localFolder = ApplicationData.Current.LocalFolder;
databasePath = Path.Combine(localFolder.Path, databaseName);
这导致在 .Net 标准库中添加了如下引用。
<Reference Include="Windows.Foundation.UniversalApiContract">
<HintPath>..\..\..\..\..\Program Files (x86)\Windows Kits\10\References\10.0.16299.0\Windows.Foundation.UniversalApiContract\5.0.0.0\Windows.Foundation.UniversalApiContract.winmd</HintPath>
</Reference>
这进而导致 Android 应用程序出现错误,并显示以下文本:
Can not resolve reference: `Windows.Foundation.UniversalApiContract`, referenced by `eTabber`. Please add a NuGet package or assembly reference for `Windows.Foundation.UniversalApiContract`, or remove the reference to `eTabber`.
我确实需要对 Windows.Storage 的引用,以便能够在 UWP 应用程序中找到本地存储的正确路径。我该如何解决这个问题?
【问题讨论】:
标签: c# android xamarin.forms