Xamarin - 找不到元数据文件 .../AWSSDK.SecurityToken.CodeAnalysis.dll

Xamarin - Metadata file .../AWSSDK.SecurityToken.CodeAnalysis.dll could not be found

我正在尝试在我的 Xamarin 应用程序中实现离线同步功能。我已经安装了 Nuget 包:

我在尝试重建我的应用程序时收到此错误

Severity Code Description Project File Line Suppression State Error CS0006 Metadata file '..\..\packages\AWSSDK.SecurityToken.3.3.2\analyzers\dotnet\cs\AWSSDK.SecurityToken.CodeAnalysis.dll' could not be found

对我来说,我不得不卸载错误的项目并编辑 .csproj 以具有正确的路径,如下所示:

<ItemGroup>
    <Analyzer Include="..\packages\AWSSDK.S3.3.3.10\analyzers\dotnet\cs\AWSSDK.S3.CodeAnalysis.dll" />
</ItemGroup>

我认为问题是通过 AWSToolkitPackage.vsix 安装的默认 AWS 模板创建了对代码分析器 dll 的引用,就好像为解决方案创建了一个单独的目录一样。

The simple fix is to eliminate one of the dots from where the file system references the NuGet package. I didn't have to close the solution or anything, simply open up the affected project file (likely *.csproj) in your favorite text editor and find the package reference.

差:

  ..\packages\AWSSDK.EC2.3.3.19\analyzers\dotnet\cs\AWSSDK.EC2.CodeAnalysis.dll

适合我:

   .\packages\AWSSDK.EC2.3.3.19\analyzers\dotnet\cs\AWSSDK.EC2.CodeAnalysis.dll 

在我的例子中,有三个单独的包需要更正它们的路径。请注意,一旦我升级到最新版本的 "awssdk" NuGet 包,分析器本身就会从项目的引用中删除。

That makes me think the alternate solution is to simply update all the NuGet package references and don't worry about editing the csproj file.