The name <object name> does not exists in the current context

限于喜欢 提交于 2019-12-23 12:54:05

问题


Most questions are related with old version of ASP.NET MVC. My question is related to latest .NET Core build on Framework 4.6. I created a console application and standard class library. I installed all libraries needed for running WEB on .NET Core.

Everything is working fine, views are compiled fine and debugging views also working. Unfortunately, Visual Studio shows the following on any object in view:

The name does not exists in the current context.

How can I get rid of these red underlines?

I am using this technique: Running ASP.NET Core MVC as a Console Application Project without .NET Core SDK


回答1:


This error occurred in the initial versions of .NET Core and the tooling for Visual Studio: Basically it was as if we were running release (not debug) build. Please upgrade to the latest versions, including Visual Studio 2015 Update 3, and .NET Core tooling.



来源:https://stackoverflow.com/questions/41591940/the-name-object-name-does-not-exists-in-the-current-context

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!