相关疑难解决方法(0)

什么是抑制EF警告的正确方法?

我想抑制这些警告,但我无法弄清楚如何做到这一点.

压制

msbuild entity-framework visual-studio-2013

11
推荐指数
2
解决办法
2507
查看次数

Visual Studio:禁止对命名空间中的所有文件发出警告

我的项目中有以下命名空间。

在此处输入图片说明

我想禁用特定命名空间上的特定警告(比如 Project.ViewModels)。我可以通过在GlobalSuppression.cs

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Formatting", "RCS1057:Add empty line between declarations.", Justification = "<Pending>", Scope = "type", Target = "~T:Project.ViewModels.MainViewModel.cs")]
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Formatting", "RCS1057:Add empty line between declarations.", Justification = "<Pending>", Scope = "type", Target = "~T:Project.ViewModels.TreeViewModel.cs")]
Run Code Online (Sandbox Code Playgroud)

我试图Scopetype改为namespacenamespaceanddescendants但没有奏效。

[assembly: SuppressMessage("Formatting", "RCS1057:Add empty line between declarations.", Justification = "<Pending>", Scope = "namespace", Target = "~T:Project.ViewModels")]
Run Code Online (Sandbox Code Playgroud)

知道如何解决这个问题吗?我正在使用 Visual Studio 2017。

c# code-analysis visual-studio roslyn roslyn-code-analysis

6
推荐指数
1
解决办法
2172
查看次数