17
votes

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?

1
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
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
@HansPassant what would you suggest to do when we need it? (Toast notifications) - pikausp
@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
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

1 Answers

1
votes

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