MotoSV
MotoSV

Reputation: 2368

MvvmLight, PCL and System.Runtime

I have a VS2012 solution that contains a Portable Class Library that targets .NET 4.5, Silverlight 5 and Windows Phone 8. This PCL also references MvvmLight (PCL). I then have a Windows Phone 8 project which references this PCL. For the WP8 project I loaded the MvvmLight (PCL) NuGet Package which loaded MvvmLight, MvvmLight.Extras as well as MvvmLight.Platform.WP8.

But, when I compile the WP8 project it complains that I have an indirect reference to "System.Runtime, Version=2.5.19.0". This is true because the PCL project exposes a view model that has the ViewModelBase class as a base class, which in turn requires the System.Runtime.dll.

If I reference the platform specific versions of MvvmLight in the WP8 project, i.e. the MvvmLight NuGet package, then I also have to reference the Microsoft.Bcl.Build package and when I do that I get load more errors referring to Microsoft.Threading.Tasks.Extensions.

I have tried adding the System.Runtime.dll from the Microsoft.Bcl directory, but it does not solve the problem.

Is there something I'm missing or not tried?!?

Upvotes: 2

Views: 579

Answers (1)

Daniel Plaisted
Daniel Plaisted

Reputation: 16744

This is an issue where NuGet is adding binding redirects when it shouldn't. Deleting the binding redirects for System.Runtime (and System.Threading.Tasks if it exists) from the app.config in your WP8 project should fix this.

Upvotes: 1

Related Questions