4

I am trying to implement offline sync functionality in my Xamarin App. I have installed the Nuget packages:

  • AWSSDK.SecurityToken
  • AWSSDK.SimpleDB
  • AWSSDK.CognitoSync
  • AWSSDK.CognitoIdentity

I am receiving this error when I try to rebuild my application

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

Barney Chambers
  • 2,720
  • 6
  • 42
  • 78

2 Answers2

6

For me, I had to unload the errant project and edit the .csproj to have the correct path like so:

<ItemGroup>
    <Analyzer Include="..\packages\AWSSDK.S3.3.3.10\analyzers\dotnet\cs\AWSSDK.S3.CodeAnalysis.dll" />
</ItemGroup>
Kobi
  • 135,331
  • 41
  • 252
  • 292
helo meda
  • 76
  • 1
  • 2
  • @MartinS Look for the missing dll in your solution (or get that dll from somewhere) and set the path here. Possibly you may have updated this package's version (e.g. from nuget), and this path is referring old version. – Ganesh Jadhav Nov 16 '18 at 05:51
  • I found I had multiple Analyzer paths for different versions of the same package after various nuget package updates. So I had to simply delete the redundant ones – Matt B Jul 06 '22 at 12:37
1

I believe the problem is that the default AWS template that gets installed via the AWSToolkitPackage.vsix creates a reference to the code analyzer dll's as though a separate directory was created for the solution.

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.

Bad:

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

Works for me:

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

In my case there were three separate packages that needed to have their paths corrected. Note that once I upgraded to the latest versions of "awssdk" NuGet packages the analyzers themselves were removed from the project's reference.

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.

Paul Schroeder
  • 1,460
  • 1
  • 14
  • 21