名称<对象名称>在当前上下文中不存在 [英] The name <object name> does not exists in the current context

查看:117
本文介绍了名称<对象名称>在当前上下文中不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大多数问题与ASP.NET MVC的旧版本有关. 我的问题与基于 Framework 4.6 构建的最新.NET Core有关.我创建了一个控制台应用程序和标准类库.我安装了在.NET Core上运行WEB所需的所有库.

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.

一切正常,视图可以正常编译,调试视图也可以.不幸的是, Visual Studio 在视图中的任何对象上都显示以下内容:

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

推荐答案

此错误在.NET Core的初始版本和Visual Studio的工具中发生:基本上就好像我们正在运行发行版(而非调试版).请升级到最新版本,包括Visual Studio 2015 Update 3和.NET Core工具.

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.

这篇关于名称<对象名称>在当前上下文中不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆