17

In Visual Studio 2015, I open a project that was created with Visual Studio 2013. Rebuild this project and see the following warning:

The referenced component 'System.Runtime' could not be found.

Looking at the References item in Solution Explorer, click System.Runtime, the Property window shows empty as below:

enter image description here

In Visual Studio 2013, it shows:

enter image description here

And this DLL does exist in the foler: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\Facades

So Visual Studio 2013 didn't whow warnings when I build the project, but Visual Studio 2015 does.

Is this a bug or I miss something in Visual Studio 2015?

Michael Tsai
  • 661
  • 7
  • 17
  • 12
    A project that targets .NET 4.5 should never have a dependency on System.Runtime. It is a "shim" assembly that is used in WinRT projects only. Something unspeakable happened with this project before, probably a bad nuget package. Delete the reference, see what hits the fan. – Hans Passant Jul 24 '15 at 10:45
  • It is a project targeting 4.5. I deleted that reference and it compiles OK both with VS2013 and VS2015. Now with your explanation, I feel more safe to delete the reference and push to Git repo. Thank you Hans! – Michael Tsai Jul 25 '15 at 02:09
  • @HansPassant what would you suggest to do when we need it? (Toast notifications) – pikausp Sep 16 '15 at 19:00
  • 1
    @HansPassant I also have this issue (alongside two other missing system assemblies). I can find no documentation to support your comment. Can you point to a resource that explains/confirms this? – Matt Sep 29 '15 at 17:15
  • 1
    As long as nobody wants to document what exactly hits the fan then there's not a wholeheckofalot of pointing going on. Sigh. – Hans Passant Sep 29 '15 at 17:46
  • @HansPassant Still you should make your comment the answer. I'd accept it. #WorkedForMe – Bart Nov 19 '15 at 22:34

1 Answers1

1

Include System.Runtime.InteropServices.RuntimeInformation instead of System.Runtime. It worked for me.

sbillah
  • 136
  • 1
  • 6