could not load file or assembly 'system.core version=2.0.5.0
Asked Answered
C

2

13

I was trying to use ReactiveUI in a WPF application that makes use of Prism. I installed the packages with NuGet, but simply adding the references led to the exception specified in the title during the initialization of the ModuleCatalog.

Edit:

As Pierre Arnaud pointed out, the problem is Microsoft.Bcl.Async not being able to resolve System.Core version 2.0.5.0.

We moved to Visual Studio 2012 since i first posted this question. The same problem persists and i can't even install the fix suggested by Pierre since i have installed .Net 4.5 now. The project is still targeting .Net 4.0.

Charmeuse answered 9/1, 2013 at 10:20 Comment(5)
What version of .NET is this? 4.5 or 4.0?Innocuous
Is this still not solved for you? And would it be reasonably at this point to update your question to include information about it being related to the Microsoft.BCL.Aync package? That is what I gather from the comments but it isn't in your question.Useless
@Useless I just built RxUI myself as Paul suggested. I lost the ability to use async and await keywords in .Net 4.0 (still using VS2010 that doesn't seem to support it anyway) and i had to remove the use of CallerMemberNameAttribute.Charmeuse
Good deal! We had a lot of issues with .net 4.0 using the async nuget package. It worked fine on Windows 7/Server 2008 and on but it bombed out with this system.core error message when the program was run on xp or 2003. We ended up having to install the latest patch for .net 4.0 (kb2468871). Probably doesn't help you much now, but I figured I'd mention it in case someone else runs into this question like we did. support.microsoft.com/kb/2468871Useless
The requirement for patch KB2468871 when using the Microsoft.Bcl.Async package on .NET 4.0 is also mentioned here: blogs.msdn.com/b/bclteam/archive/2012/10/22/…Bloodandthunder
T
17

Please install KB2468871, which solves the issue related to Microsoft.Bcl.Async not being able to resolve System.Core version 2.0.5.0.

See also Issue 8 in the async targeting pack knowledge base.

Here are the direct download links for the fixes, for the x86 and x64 environments:

Tshirt answered 12/8, 2013 at 5:24 Comment(4)
That was it! Thanks a ton. Now I need to decide what's better: require the users to install the KB or not use BCL async at all.Rory
You can include the installation of the KB fix in your own installer. All you have to do is make sure you don't install it if it is not required.Tshirt
Yes, I meant already installed or maybe obsoleted by a more recent release of .NET, who knows, but that's more difficult to foresee ;-)Tshirt
When we moved to Visual Studio 2012 i thought this problem would go away, but with no luck. Now i can't even try to install the fix since i don't have .Net 4 installed anymore. The project is still targeting .Net 4.0.Charmeuse
I
0

This isn't happening for me. Is it possible that NuGet has added the SL5 DLLs as a reference to your project?

Innocuous answered 11/1, 2013 at 18:30 Comment(6)
Well i found the guilty package. It's Microsoft.Bcl.Async, even though it's pointing to the net40 library. By removing it i can start the app without errors, but Microsoft.Bcl depends on it (at least that's what NuGet complains about) and if i remove Microsoft.Bcl i get a "Could not load System.Threading.Tasks" exception. Now i guess i'll get a runtime exception if and when Microsoft.Bcl will need that package. Btw i'm using Visual Studio 2010, maybe that's the problem?Charmeuse
Interesting. Yes, I believe you need to be running VS2012 (you can definitely still compile down to NET 4.0). I know that sucks, but the upside is that you get to use async/awaitInnocuous
Well i'll have to persuade my boss to buy me a copy of VS2012 then, cause i find your work brilliant and i can't wait to try it on a real world app :)Charmeuse
Thank you! In the meantime, if you change your package.config to use ReactiveUI < 4.x (i.e. 3.x series), you should be able to use VS2010. You could also probably make RxUI latest work against VS2010 if you built it yourself and removed Microsoft.Bcl.AsyncInnocuous
@Paul Betts: This does happen in VS2012! I have no reliable repro steps though. I'll ask the dev that's having this issue to comment. I can confirm that we've started seeing the issue once Microsoft.Bcl.Async was addedProximate
@ChrisBednarski Can you verify that all of your projects have Microsoft.Bcl.Async installed? Sometimes weird things happen if one project does and one doesn't.Innocuous

© 2022 - 2024 — McMap. All rights reserved.