3

The title says it. This isn't really the end of the world, but it's an annoyance. If I rename a Blazor component, IntelliSense breaks and still accepts the old name until I restart Visual Studio. I also get an error when trying to do the rename.

I'm using Visual Studio 2019 Professional. Is this a known issue in VS?

Here's the stack trace of the error:

StreamJsonRpc.RemoteInvocationException: Unexpected false at StreamJsonRpc.JsonRpc.d__1331.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteEndPoint.<InvokeAsync>d__211.MoveNext() --- End of stack trace from previous location where exception was thrown --- at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) RPC server exception: System.InvalidOperationException: Unexpected false at Roslyn.Utilities.Contract.Fail(String message) at Roslyn.Utilities.Contract.ThrowIfFalse(Boolean condition) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__14.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__13.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__8.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__7.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.SolutionCreator.d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.<CreateSolution_NoLockAsync>d__10.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.RemoteWorkspace.d__12.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.CodeAnalysisService.<>c__DisplayClass29_0.<b__0>d.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.CodeAnalysis.Remote.ServiceBase.d__16`1.MoveNext()

1 Answer 1

2

Is this a known issue in VS?

I guess it is, at least for both of us... My solution: Double click on the Blazor's project name, and remove all the settings added by VS in reference to naming changes made.

Of course, you may post an issue in github...

UPDATE:

Note this experiment: I renamed Index.razor to Index.txt, and then opened the csproj file. VS added these settings:

<ItemGroup>
    <None Remove="Pages\Index.txt" />
  </ItemGroup>

  <ItemGroup>
    <Content Include="Pages\Index.txt" />
  </ItemGroup>

Again, I renamed Index.txt to Index.razor... VS has removed these elements. No issues. I'm using community version, but when I was using the professional version, I had to remove them manually...But alas, it took me some time to realize this (rather by change than by being smart...)

Another experiment: Renamed Counter.razor to Counter2.razor... tried to add an element for Counter2 in the Index page: <Counter2 />, but it is rejected. I could still use <Counter />, which does not exist any longer. Only after closing the Index page and opening it did it recognize the new changes...

Sign up to request clarification or add additional context in comments.

2 Comments

Okay, I did go ahead and submit an issue on their github. Could you help expand on what you mean by your workaround? If I double click the project I get to the csproj file, but I don't see any settings related to naming changes.
Ahh, I see. I didn't realize I could just close the file and reopen it. I was restarting VS completely. So I guess this is a little better. Anyways, not exactly the solution I was hoping for, but I guess it's the best we've got until it's fixed, so I'll go ahead and mark this as answered as it's going to get at this point :) Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.