Visual Studio 2015 / ASP.NET 5 Core Framework Preview: Dictionary of type or namespace <,> does not exist

I downloaded the Visual Studio 2015 preview from Microsoft website (version 14.0.22310.1 DP), clicked File -> New Project -> ASP.NET 5 Console Application, creating a default template. Everything has been built so far.

I added the line ( var dictionary = new System.Collections.Generic.Dictionary<string, string>();

) which resulted in the write method shown below.

public void Main(string[] args)
{
    var dictionary = new System.Collections.Generic.Dictionary<string, string>();
    Console.WriteLine("Hello World");
    Console.ReadLine();
}

      

However, in assembly, the compiler tells me that there is no Generic Dictionary implementation in the Core framework. The error message is below:

Error CS0234 The type or namespace name "Dictionary" does not exist in the namespace "System.Collections.Generic" (are you missing an assembly reference?) ProjectName.ASP.NET Core 5.0 Program.cs 9

project.json file:

{
    "version": "1.0.0-*",
    "dependencies": {
    },
    "commands": { 
        "run" : "run"
    },
    "frameworks" : {
        "aspnet50" : { },
        "aspnetcore50" : { 
            "dependencies": {
                "System.Console": "4.0.0-beta-22231"
            }
        }
    }
}

      

In project properties -> application tab. The default target version of KRE is KRE-CLR-x86.1.1.0-beta 1.

Unfortunately, standard Google and StackOverflow searches did not provide an answer. Any ideas?

+3


source share


2 answers


Add system collectives to your core dependencies, or remove your core structure.



    "frameworks" : {
        "aspnet50" : { },
        "aspnetcore50" : { 
            "dependencies": {
               "System.Collections": "",
                "System.Console": "4.0.0-beta-22231"
            }
        }
    }

      

+4


source


Perhaps this is now in a new build, System.Collections.dll

and no longer in mscorlib.dll

? As the error text asks, is the assembly reference missing from the project file?



+1


source







All Articles