vb.net - Visual Studio 2015 Analyzer 引发异常

标签 vb.net visual-studio visual-studio-2015 code-analysis

更新后VS 2015 更新 1 RC VS 2015 更新 1 ,我不断收到以下错误消息:

Analyzer 'Microsoft.CodeAnalysis.VisualBasic.CodeFixes.SimplifyTypeNames.VisualBasicSimplifyTypeNamesDiagnosticAnalyzer' threw an exception of type 'System.ArgumentNullException' with message 'Value cannot be null. Parameter name: source'


在我的一个项目中。 代码分析 在该项目上被禁用(就像我在解决方案中的所有项目一样),所以我尝试打开和关闭它,但仍然是同样的问题。
似乎我仍然可以构建和运行我的解决方案,但升级后事情似乎并不能正常工作:
  • 一切都运行得很慢
  • 进行更改并构建后,它不会应用更改

  • 有没有其他人在最近的更新之后甚至之前遇到过这个问题?
    在这里找到了潜在的解决方法:https://github.com/dotnet/roslyn/issues/6682用户发布 dpoeschl .
    这是他的原文:

    Workaround: Check this checkbox: Tools | Options | Text Editor | Basic | Code Style | Qualify member access with 'Me'

    dpoeschl's solution

    This workaround has two side-effects (that I can think of so far):

    1. You will no longer get a visual indicator of the superfluous Me. or the associated code-fix, or the "Fix all occurrences in" options for easily achieving compliance.

    2. Any code generation features that generate fully qualified member accesses and depend on the Simplifier to remove them if appropriate (or that explicitly check this option) will now generate non-compliant code by default.

    Enabling this option is particularly non-invasive in both VS2015 & VS2015 Update 1 because this option is only enforced in one direction. That is, the checkbox being unchecked means the analyzer runs, does some deeper analysis (that fails in this case), and offers you a lightbulb when you have qualified member accesses, while the checkbox being checked means that we opt out of the deeper analysis very early and you don't get any lightbulbs telling you to add Me. qualification.


    它对我有用,它也可以解决其他人的问题。

    最佳答案

    这是更新 1 中引入的缺陷,并且已经被跟踪 at Roslyn GitHub as #6682自 2015 年 10 月 11 日起。
    检查那里的状态更新。

    更新: Visual Studio 2015 Update 2 is now out问题在那里得到解决。

    关于vb.net - Visual Studio 2015 Analyzer 引发异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34042055/

    相关文章:

    c# - 如何在一处更改解决方案中所有项目的 C# 语言版本?

    Visual Studio 2015 中未检测到 Android 手机

    vb.net - 内部交换 smtp 服务器上的 system.net.mail 出现大量邮件超时

    C# 之于 Visual Studio 就像 PHP 之于……什么?

    用于 opengl 的 C++ nuget 包

    installation - 如何从 InstallShield 迁移到 Visual Studio 安装程序项目

    node.js - Visual Studio 2015 Taks 运行程序资源管理器导致多个 node.exe 进程

    vb.net - 为什么 Visual Studio 在设计器打开时修改 "Windows Form Designer generated code"?

    mysql - 在 VB.NET 中寻找在 MYSQL 中搜索字符串模式的有效过程

    c# - 从文件中读取一对数字并处理它们的快速且低内存消耗的方法?