从 更新后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'
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/