user3141326
user3141326

Reputation: 1533

ResolveAssemblyReference Could not load file or assembly - Xamarin - PCL Library -

I upgraded to latest version of Xamarin Studio(5.0.878) in MAC OSX Mountain Lion . I have a basic setting with a PCL project - which contains .NET Portable subset as expected.

And I have an android project that refers to this PCL project. However when I include the PCL project in the references and try to compile - I get that error below:

/Library/Frameworks/Mono.framework/Versions/3.4.0/lib/mono/4.5/Microsoft.Common.targets: Error: Error executing task ResolveAssemblyReference: Could not load file or assembly '/Users/uakdemir/Projects/Likya/CoreLib/bin/Debug/System.Diagnostics.Tools.dll' or one of its dependencies. The system cannot find the file specified. (MyIncludedPCLProject)

Inside the .NET Portable subset (which is added as default by Xamarin) - I see the System.Diagnostics.Tools. I never refer to that namespace in my solution (I refer to System.Diagnostics).

No matter what I tried I was not able to get over that ResolveAssemblyReference error - there are some links on the web saying that it is a bug of xbuild - it was introduced in .NET 4.0 - with suggestions of reverting to .NET 3.5 - which I cannot since I will be using async and await in the project. Googling does not help either.

Is there a workaround you know for this ResolveAssemblyReference issue? Why is msbuild trying to look for an assembly that is supposed to be in the .NET Portable Subset for PCL in the output folder for the PCL library?

I may be missing some information since I am not much experienced with this error - please bear with me and ask any additional details that might be needed.

Thanks a lot

Upvotes: 3

Views: 2477

Answers (2)

Jannie Theunissen
Jannie Theunissen

Reputation: 30114

What worked for me was:

  1. Build > Clean all
  2. File > Close solution
  3. File > Open solution
  4. Project > Update NuGet packages

c# project in Xamarin 5.9.8, OSX El Capitan

Upvotes: 2

super_J
super_J

Reputation: 234

I had the exact same error in Monodevelop with my F# project I am bootstrapping and what I did was close the solution and re-opened it and saw that I was prompted that updates for some of the packages in my project were available for download, so I installed the package updates and my project ran fine after that. So you might want to give that a try.

Upvotes: 1

Related Questions