News for hackers. Stuff that matters.
Re:The Little ASP.NET Core Book by thorin on Wednesday September 20, 2017 @06:01AM (#15292087)
Enjoying the book, I'm new to to asp and razor although I have done a little .net wep api before.

I have an issue with the first view, when running I get the error below on all references in the cshtml. I'm using a stock install of VS 2017. Any ideas?

/Views/Todo/Index.cshtml(4,5): error CS0103: The name 'ViewData' does not exist in the current context /Views/Todo/Index.cshtml(8,33): error CS0103: The name 'ViewData' does not exist in the current context /Views/Todo/Index.cshtml(8,27): error CS0103: The name 'Write' does not exist in the current context /Views/Todo/Index.cshtml(19,31): error CS0103: The name 'Model' does not exist in the current context /Views/Todo/Index.cshtml(23,1): error CS0103: The name 'WriteAttributeValue' does not exist in the current context /Views/Todo/Index.cshtml(25,16): error CS0103: The name 'Write' does not exist in the current context /Views/Todo/Index.cshtml(26,16): error CS0103: The name 'Write' does not exist in the current context

Re:The Little ASP.NET Core Book by Yusho on Wednesday September 20, 2017 @06:54AM (#15292336)
Did you also install the .Net Core 2.0 SDK?
Re:The Little ASP.NET Core Book by thorin on Wednesday September 20, 2017 @07:03AM (#15292396)
Not yet, and I was thinking that this might be the issue - would you expect this to be required?

dotnet --version shows 1.1.0, I think I assumed that the latest VS2017 would have the latest dotnet core but this doesn't seem to be the case.

Re:The Little ASP.NET Core Book by Yusho on Wednesday September 20, 2017 @08:46AM (#15293104)
This is a common misconception, VS2017 doesn't ship with the .Net Core SDK, you need to manually install it seperatly. This is also described in the Book: https://nbarbettini.gitbooks.io/little-asp-net-core-book/con...
Re:The Little ASP.NET Core Book by thorin on Wednesday September 20, 2017 @08:56AM (#15293189)
Thanks for pointing this out, this did indeed fix the problem. Somewhere in the installation I had ended up with 1.1 but it works fine now.