Visual Studio shows a warning with the message 'RoslynatorCodeRefactoringProvider' encountered an error and has been disabled when I open a project with the following C# file opened automatically with the project:
internal class Program
{
    static void Main(string[] args)
    {
    }
}
And with the caret being on the first line, I quickly do:
- Go to the end of the line
- Add a semicolon, comma or minus symbol (and I assume anything that causes a code error)
- Go back to the start of the line
It doesn't happen if first I wait for a pair of seconds (I guess after VS or Roslynator have initialized?).
It also happens if, instead of those steps, the caret is on the word internal, I don't move it, and execute a command from a custom extension that adds a semicolon at the end of the line without moving the caret, so I assume it has more to do with the code error with the semicolon/whatever at the end while the caret is on internal than anything else.
The exception stack trace is:
System.InvalidCastException : Unable to cast object of type 'Microsoft.CodeAnalysis.CSharp.Syntax.CompilationUnitSyntax' to type 'Microsoft.CodeAnalysis.CSharp.Syntax.MemberDeclarationSyntax'.
   at Roslynator.CSharp.Refactorings.AccessModifierRefactoring.<>c__DisplayClass0_0.<ComputeRefactoringsAsync>b__1(SyntaxReference f)
   at System.Collections.Immutable.ImmutableArray.CreateRange[TSource,TResult](ImmutableArray`1 items,Func`2 selector)
   at async Roslynator.CSharp.Refactorings.AccessModifierRefactoring.ComputeRefactoringsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Roslynator.CSharp.Refactorings.RefactoringContext.ComputeRefactoringsForTokenAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Roslynator.CSharp.Refactorings.RefactoringContext.ComputeRefactoringsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Roslynator.CSharp.Refactorings.RoslynatorCodeRefactoringProvider.ComputeRefactoringsAsync(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.<>c__DisplayClass12_0.<GetRefactoringFromProviderAsync>b__0(<Unknown Parameters>)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)