Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I've created a Portable Class Library, using the nuget packages for JSON.NET and the Async package

when I try and serialize a class within the portable library I get this error, in my unit test project

Could not load file or assembly 'System.Runtime, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

I only seem to get it when there is an public async method on the class. Also if I recreate the class within in the test project then it works fine. The error only occurs when calling into the portable library (to serialize a class with an async method)

share|improve this question
 
found a solution here blogs.msdn.com/b/bclteam/p/asynctargetingpackkb.aspx it seems i need to manually edit the app config as nuget isn't doing this correctly for different frameworks. the two solutions i found worked were either to change the version number to 4.0.0.0 for example. or just to comment it out entirely. –  theboyknowsclass Aug 9 at 13:33
add comment

1 Answer

You should be able to remove any binding redirects from your app.config for assemblies installed as part of the Microsoft.Bcl or Microsoft.Bcl.Async NuGet packages. The Microsoft.Bcl.Build package will add the correct binding redirects at compile time.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.