我有一个我在VS14 ctp3中创建的解决方案,它运行得很好 更新到VS14 ctp4,我有很多错误。
Error Diagnostic_CS 2 'CancellationToken' is ambiguous in the namespace 'System.Threading'.
如何?
错误Diagnostic_CS 4方法' Public Sub Check_FormatString(节点As Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax,sm 作为Microsoft.CodeAnalysis.SemanticModel,addDiagnostic As System.Action(of Microsoft.CodeAnalysis.Diagnostic),ct As CancellationToken,fsi As Integer,ArgObjs As System.Collections.Generic.IEnumerable(Of Object))'没有 签名兼容委托' Delegate Sub System.Action(Of Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax, Microsoft.CodeAnalysis.SemanticModel,System.Action(Of Microsoft.CodeAnalysis.Diagnostic),CancellationToken,Integer, System.Collections.Generic.IEnumerable(Of Object))(arg1 As Microsoft.CodeAnalysis.CSharp.Syntax.MemberAccessExpressionSyntax, arg2作为Microsoft.CodeAnalysis.SemanticModel,arg3 As System.Action(Of Microsoft.CodeAnalysis.Diagnostic),arg4 As CancellationToken,arg5 As 整数,arg6 As System.Collections.Generic.IEnumerable(Of Object))'。]
我甚至不理解第二个中提到的代表。什么是arg1,arg2参数。
错误Diagnostic_CS 71 Class' DiagnosticAnalyzer'必须实现Sub AnalyzeNode(节点为Microsoft.CodeAnalysis.SyntaxNode,semanticModel为Microsoft.CodeAnalysis.SemanticModel,addDiagnostic为System.Action(of Microsoft.CodeAnalysis.Diagnostic)),选项为Microsoft.CodeAnalysis.Diagnostics.AnalyzerOptions,cancellationToken正如System.Threading.CancellationToken)' for interface' ISyntaxNodeAnalyzer(Of SyntaxKind)'。
它已实施。我认为这是因为cancelToken被报告为含糊不清。
它的根本原因/问题是什么,所以我可以解决它?
修改
加载解决方案时,项目缺少参考
System.Runtime
System.Threading
尝试添加引用缺少引用。仍然无法编译。