Gillardo
Gillardo

Reputation: 9818

The type 'X' is defined in an assembly that is not referenced. VS2015/aspnetcore/c#

I am using rc2 aspnetcore and my project builds and runs fine if i use the command dotnet run, but in visual studio i get 700+ errors saying

The type'X' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version 4.0.0.0, Culture=netrual... '

Why is this? Should i have to add the reference of System.Runtime to my project.json file in order for VS2015 not to throw these exceptions upon building?

I am using dotnet cli version 1.0.0-preview2-002913 to run my code.

Upvotes: 1

Views: 84

Answers (1)

Marcus
Marcus

Reputation: 8669

Add System.Runtime to "frameworkAssemblies" to your project.json:

"frameworks": {
    "net451": {
        "frameworkAssemblies": {
            "System.Runtime": "4.0.10.0"
        }
    },

Upvotes: 1

Related Questions