title: Roslyn CodeFixProvider gives VS 2015 error
body: <p>I have created a roslyn CodeAnalyzer and a CodeFixProvider.</p>
  
  <p>The Analyzer runs fine, and creates the rule, but when I'm trying to open the popup showing the fix, I get a <strong>"One or more errors occurred"</strong> VS popup.</p>
  
  <p>First time I ran it, it worked fine, but then I stopped debugging and after that it gave me that error, so I tried on another computer and again it worked fine the first time I debugged.</p>
  
  <p>My Analyzer:</p>
  
  <pre><code>private static void Analyze(SyntaxNodeAnalysisContext context)
  {
      var localDeclaration = (LocalDeclarationStatementSyntax)context.Node;
  
      foreach (var variable in localDeclaration.Declaration.Variables)
      {
          var initializer = variable.Initializer;
          if (initializer == null) return;
      }
  
      var node = context.Node;
  
      while (node.Kind() != SyntaxKind.MethodDeclaration)
      {
          node = node.Parent;
      }
  
      var method = (MethodDeclarationSyntax)node;
  
      if (method.AttributeLists.Any(x =&gt; x.Attributes.Any(y =&gt; y.Name is IdentifierNameSyntax &amp;&amp; ((IdentifierNameSyntax)y.Name).Identifier.Text.ToLower().Contains("test"))))
      {
          context.ReportDiagnostic(Diagnostic.Create(Rule, context.Node.GetLocation()));
      }
  }
  </code></pre>
  
  <p>My CodeFixProvider</p>
  
  <pre><code>private async Task&lt;Document&gt; AddAssertionsAsync(Document document, LocalDeclarationStatementSyntax localDeclaration, CancellationToken cancellationToken)
  {
      var editor = await DocumentEditor.CreateAsync(document, cancellationToken);
  
      var assert = SyntaxFactory.IdentifierName("Assert");
      var areEqual = SyntaxFactory.IdentifierName("AreEqual");
  
      var memberAccess = SyntaxFactory.MemberAccessExpression(SyntaxKind.SimpleMemberAccessExpression, assert,
              areEqual);
  
      var firstArgument = SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(@"")));
      var secondArgument = SyntaxFactory.Argument(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(@"")));
  
      var argumentList = SyntaxFactory.SeparatedList&lt;ArgumentSyntax&gt;(
          new SyntaxNodeOrToken[] {
              firstArgument,
              SyntaxFactory.Token(SyntaxKind.CommaToken),
              secondArgument
          });
  
      var assertToken =
          SyntaxFactory.ExpressionStatement(
          SyntaxFactory.InvocationExpression(memberAccess,
          SyntaxFactory.ArgumentList(argumentList)));
  
      editor.InsertAfter(localDeclaration, assertToken);
      var newDocument = editor.GetChangedDocument();
  
      return newDocument;
  }
  </code></pre>
  
  <p>What I'm trying to achive is</p>
  
  <pre><code>[Test]
  public void blah()
  {
      var stat = string.Empty;
  }
  </code></pre>
  
  <p>Becomes</p>
  
  <pre><code>[Test]
  public void blah()
  {
      var stat = string.Empty;
      Assert.AreEqual("", "");
  }
  </code></pre>
  
  <p>When you press ctrl+. on "stat"... And it is here that VS2015 gives the error, just not first time...</p>