简体   繁体   English

IDE0007 Visual Studio错误不会阻止构建,但是不会消失。 我如何摆脱它?

[英]IDE0007 Visual Studio error isn't preventing build but won't go away. How do i get rid of it?

We just switched from VS 2015 to VS 2017 a week ago, and when I opened the project in 2017, we got all kinds of errors, including but not limited to the following: 一周前我们刚刚从VS 2015切换到VS 2017,当我在2017年打开该项目时,我们遇到了各种各样的错误,包括但不限于以下错误:

IDE0007 - Use var instead of explicit type IDE0022 - Use expression body for methods IDE0007-使用var代替显式类型IDE0022-使用表达式主体作为方法

I don't want these as errors. 我不希望这些是错误。 I want them as suggestions AT BEST. 我希望它们是最好的建议。 preferably i need them to go away completely. 最好我需要他们完全消失。 but no matter what i do, i can't fix it. 但无论我做什么,我都无法解决。 i went into tools -> options -> code style preferences to no avail. 我进入工具->选项->代码样式首选项无济于事。 I changed them all to "suggestions" but it hasn't changed anything. 我将它们全部更改为“建议”,但没有任何改变。 They're all showing up as suggestions, warnings, AND errors at the same time. 它们都同时显示为建议,警告和错误。

I don't have any extensions installed. 我没有安装任何扩展程序。 I thought maybe resharper, but it isn't there. 我以为也许是修磨者,但它不存在。 We've used StyleCop from the start of the project, but it has NEVER complained about these errors, and it never marks them as errors, it always marks them as warnings. 我们从项目开始就使用了StyleCop,但从未抱怨过这些错误,并且从未将其标记为错误,而是始终将其标记为警告。 I'm at a loss. 我很茫然。 Any help would be greatly appreciated. 任何帮助将不胜感激。

I re-ran the VS 2017 installer and modified it by adding an extra package (data and analytics). 我重新运行了VS 2017安装程序并通过添加一个额外的程序包(数据和分析)对其进行了修改。 when i brought it back up, it was fixed. 当我将其备份时,它是固定的。 not much of an answer, i'm sorry. 答案不多,对不起。 but a commenter above said that the data to which I'm referring is stored in the references node of the project. 但是上面的评论者说,我要引用的数据存储在项目的引用节点中。

I ran into the same problem, and I was able to hide those kinds of errors by selecting the "Build Only" option from the dropdown in the Error List menu (instead of "Build + IntelliSense", which was showing by default for me) 我遇到了同样的问题,并且可以通过从“错误列表”菜单的下拉菜单中选择“仅构建”选项来隐藏这些类型的错误(而不是默认显示的“构建+ IntelliSense”)

Here is a screenshot of the ErrorList and dropdown 这是ErrorList和下拉菜单的屏幕截图

在此处输入图片说明

EDIT: Unfortunately, the build error underlines still show up on my file. 编辑:不幸的是,生成错误下划线仍然显示在我的文件上。 I am trying to resolve that now. 我现在想解决这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 新手,无法构建程序 - New to Visual Studio, program won't build 如何通过统一针对 Visual Studio 中错误的 .NET 框架来消除此错误警告 - How do I get rid of this error warning with unity targeting the wrong .NET framework in Visual Studio Roslyn CodeFixProvider未在Visual Studio IDE中加载或运行。 我想念什么? - Roslyn CodeFixProvider isn't loading or running in the Visual Studio IDE. What am I missing? WPF我如何确保我画的线不被混淆? - wpf how do I ensure that a line i draw isn't aliased away? 无法摆脱 Visual Studio 2022 中的 ErrorProvider 消息 - Can't get rid of ErrorProvider message in Visual Studio 2022 Visual Studio不会构建到exe(.NET Core 2.0) - Visual Studio won't build to exe (.NET Core 2.0) 在Visual Studio中生成的代码不会在TFS中生成 - Code that Builds in Visual Studio Won't Build in TFS Visual Studio C# 应用程序无法使用调试信息构建 - Visual Studio C# app won't build with debugging info 如何获得本地 Visual Studio 构建完成的通知? - How do I get notification that the local Visual Studio build is complete? 如何在活动的Visual Studio配置中构建项目? - How do I get the projects to build in the active Visual Studio configuration?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM