简体   繁体   中英

Microsoft Fakes: Could not resolve assembly 'System.Runtime.Serialization, Version=2.0.5.0 …"

I'm using Visual Studio 2013 Premium and trying to "Add Fakes Assembly" to a test project. The initial build gives me this error:

error : Could not resolve assembly 'System.Runtime.Serialization, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e, Retargetable=Yes'. Are you missing an assembly reference?

The test project and the project it's targeting are both using .net 4.0. My target project does indeed use System.Runtime.Serialization, but the 4.0 version (naturally).

Why am I getting this error and how can I resolve this issue?

This is one of those slightly odd semi-ephemeral quasi-bugs that pop up from time to time. I encountered it this week through FxCop and was unable to find any resolution to it (although I didn't install Silverlight as I couldn't risk bringing down our build server).

People say that it might be to do with binding redirection for Silverlight, others have said it has something to do with portable class libraries.

Your mileage may vary; but there other people with the same problem and it seems there is no definitive cause or solution at the moment.

FxCop analysis not finding indirectly-referenced assemblies - GAC issue?

FxCop indirect reference to System.Core version 2.0.5.0

https://github.com/AutoMapper/AutoMapper/issues/383

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM