A very strange problem encountered in the development of a ASP.NET5, the NuGet package of the reference part did not show any errors, such as:
But there were hundreds of errors at compile time:
Errors are basically shaped like "CS0246 the type or namespace name ' Key ' could not being found (is you missing a using directive or an assembly Refe Rence?) "This error,
The first thing that comes to mind is that the NuGet package refers to a problem, but no matter how you check it, you can't find out what's wrong.
Even more bizarre, this solution in the company can be compiled normally, at night home debugging only to appear this situation. Later carefully considered a bit, because at that time, the beta7 just updated, the middle of a long time, it is suspected that the DNX version of the problem.
Then I checked the project properties, found that the solution worked under BETA5, and the NuGet package was updated to Beta7,
That is, the version of the reference package and the work version of the solution is inconsistent, to solve the problem is very simple, the work version is also changed to BETA7 version can be:
And then recompile, everything works.
ASP.NET5 development, there are a lot of similar problems, especially when setting the version of the dependencies package in Project.json, be sure to keep the version consistent.
Impact of the DNX SDK version in ASP.NET5 development