Visual Studio 2017禁用依赖关系验证 [英] Visual Studio 2017 disable Dependency Validation

查看:406
本文介绍了Visual Studio 2017禁用依赖关系验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Visual Studio 2017 RC中禁用依赖关系验证? 每当我打开C#解决方案时,它总是在解决方案资源管理器中向我显示一条消息:需要更新一个或多个项目才能执行依赖关系验证",并带有更新"按钮. 当我第一次打开它时,它执行了一些软件包和配置文件的自动更新,后来我不得不将其删除.

How to disable Dependency Validation in Visual Studio 2017 RC? Whenever I open C# solution it always shows me a message in the Solution Explorer: "One or more projects needs to be updated to perform dependency validation" with an Update button. When I opened it for the first time, it performed some automatic update of packages and config files that I had to remove later.

我需要在VS2017和VS2015之间共享解决方案,并且不想引入任何向后不兼容的情况.

I need to share the solution between VS2017 and VS2015 and don't want to introduce any backward incompatabilities.

推荐答案

对项目所做的更改与Visual Studio 2015 Update 2或更高版本兼容.

The changes made to the projects are compatible with Visual Studio 2015 Update 2 or later.

所有项目更新所做的只是添加对 Microsoft.DependencyValidation.Analyzers NuGet程序包,并添加一个到依赖项验证模型文件的链接作为 AdditionalFile ,以便将其传递给Roslyn分析器.

All the project update does is add a reference to the Microsoft.DependencyValidation.Analyzers NuGet package, and add a link to the dependency validation model file as an AdditionalFile so that it is passed to the Roslyn analyzers.

依赖性验证分析器使用的是Roslyn 1.2(VS2015更新2附带),而不是VS2017附带的较新版本的Roslyn,这样分析就可以在Visual Studio的旧版本中使用.

The dependency validation analyzers use Roslyn 1.2 (which shipped with VS2015 update 2), rather than the newer version of Roslyn that shipped with VS2017 precisely so that the analysis would work in older versions of Visual Studio.

Tools-Options-Dependency Validation 选项的作用与对话框中的描述完全相同:如果您使用依赖关系验证(例如,有解决方案,它可以控制是否在金条中显示警告)带有依赖关系验证图的建模项目),但代码分析设置完整解决方案分析已关闭. 吉恩-Marc Prieur的博客文章解释了为什么在使用依赖项验证时可能希望启用完整的解决方案分析.

The Tools-Options-Dependency Validation option does exactly what the description in the dialogue says: it controls whether a warning is shown in a gold bar if you are using dependency validation (i.e. have a solution with a modeling project with a dependency validation diagram) but have the code analysis setting full solution analysis turned off. Jean-Marc Prieur's blog post explains why you might want to turn full solution analysis on when using dependency validation.

这篇关于Visual Studio 2017禁用依赖关系验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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