visual studio 2017允许编译APP,同时存在“当前上下文中不存在”错误 [英] visual studio 2017 allows APP to be compiled while there are “does not exists in the current context” error

查看:190
本文介绍了visual studio 2017允许编译APP,同时存在“当前上下文中不存在”错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在以前的版本中,此类错误导致应用程序无法编译但新版本存在非常严重的问题



例如,此对象在上下文中确实不存在,但它未显示在构建错误列表中,并且应用程序正在运行而不会在按F5按钮时出现任何错误。当然,当调用ASP.net页面时应用程序抛出错误



但我希望visual studio能够显示错误并在我尝试运行时抛出异常像以前版本的应用程序







此外,intellisense错误非常烦人。为什么它们出现?这里如何显示数百个









下面安装的Visual studio完整版。这是一个干净的新安装



 Microsoft Visual Studio Enterprise 2017(2)
版本15.2(26430.16)发布
VisualStudio。 15.Release / 15.2.0 + 26430.16
Microsoft .NET Framework
版本4.7.02053

已安装版本:Enterprise

Visual Basic 2017 00369- 60000-00001-AA392
Microsoft Visual Basic 2017

Visual C#2017 00369-60000-00001-AA392
Microsoft Visual C#2017

Application Insights工具for Visual Studio Package 8.6.00404.2
Visual Studio的应用程序洞察工具

ASP.NET和Web Tools 2017 15.0.30503.0
ASP.NET和Web Tools 2017

ASP.NET Web框架和工具2017 5.2.50303.0
有关其他信息,请访问https://www.asp.net/

Azure App Service Tools v3.0.0 15.0 .30209.0
Azure应用服务工具v3.0.0

通用Azure工具1.9
提供供Azure移动服务和Microsoft Azure工具使用的通用服务。

JavaScript语言服务2.0
JavaScript语言服务

KofePackagePackage扩展1.0
KofePackagePackage Visual Studio扩展详细信息

Microsoft Azure工具2.9
用于Microsoft Visual Studio 2017的Microsoft Azure工具 - v2.9.50131.1

基于Microsoft MI的调试器1.0
支持将Visual Studio连接到MI兼容的调试器

NuGet包管理器4.2.0
Visual Studio中的NuGet包管理器。有关NuGet的更多信息,请访问http://docs.nuget.org/。

SQL Server数据工具15.1.61702.140
Microsoft SQL Server数据工具

TypeScript 2.2.2.0
Visual Studio的TypeScript工具








基于浏览器< a href =" http://www.monstermmorpg.com"> ;口袋妖怪< / A>风格MMORPG游戏开发者使用asp.net 4.0路由它的< a href =" http://www.monstermmorpg.com/MonsterDex">怪物< / a>

解决方案

嗨朋友,


我有过这样的经历,有数百个智能感知错误和0个构建错误。删除
.suo文件后,重新启动的VS 智能感知错误消失了。


* .soo是一个隐藏文件。


对于VS2017有同样的问题,所以你可以使用类似的解决方案:删除
.vs \ Solution name \v15.suo


 


祝你好运,


Fletcher



In previous versions, such errors were preventing application to get compiled but new one have very serious problems

For example this object really not exists in the context but it is not shown in build error list and application is running without giving any error when hit to F5 button. Of course the application throws error when that ASP.net page is called

But i would expect visual studio to show that error and throw exception when i try to run the application like previous versions

Moreover, intellisense errors are extremely annoying. Why they appear? Here how they are shown hundreds of them

full version of installed visual studio below. it is a clean new installation

Microsoft Visual Studio Enterprise 2017 (2)
Version 15.2 (26430.16) Release
VisualStudio.15.Release/15.2.0+26430.16
Microsoft .NET Framework
Version 4.7.02053

Installed Version: Enterprise

Visual Basic 2017   00369-60000-00001-AA392
Microsoft Visual Basic 2017

Visual C# 2017   00369-60000-00001-AA392
Microsoft Visual C# 2017

Application Insights Tools for Visual Studio Package   8.6.00404.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2017   15.0.30503.0
ASP.NET and Web Tools 2017

ASP.NET Web Frameworks and Tools 2017   5.2.50303.0
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   15.0.30209.0
Azure App Service Tools v3.0.0

Common Azure Tools   1.9
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

JavaScript Language Service   2.0
JavaScript Language Service

KofePackagePackage Extension   1.0
KofePackagePackage Visual Studio Extension Detailed Info

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2017 - v2.9.50131.1

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

NuGet Package Manager   4.2.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

SQL Server Data Tools   15.1.61702.140
Microsoft SQL Server Data Tools

TypeScript   2.2.2.0
TypeScript tools for Visual Studio



Browser based <a href="http://www.monstermmorpg.com">Pokemon</a> Style MMORPG Game Developer Used asp.net 4.0 routing at it's <a href="http://www.monstermmorpg.com/MonsterDex">Monsters</a>

解决方案

Hi friend,

I had this experience once, with hundreds of intellisense errors and 0 build errors. After deleting .suo file an restarting VS intellisense errors are gone.

*.suo is a hidden file.

For VS2017 has the same issue, so you can use similar solution: Delete .vs\SolutionName\v15.suo

 

Best regards,

Fletcher


这篇关于visual studio 2017允许编译APP,同时存在“当前上下文中不存在”错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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