|
-
Apr 24th, 2023, 12:15 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Invalid Operation exception
I have the following notice showing up in Visual Studio (2022).
'VisualBasicMoveStaticMembersRefactoryingProvider' encountered an error and has been disabled.
Stack Trace:
System.InvalidOperationException : Operation is not valid due to the current state of the object.
at Microsoft.CodeAnalysis.Shared.Extensions.SemanticModelExtensions.GetRequiredDeclaredSymbol(SemanticM odel semanticModel,SyntaxNode declaration,CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.MoveStaticMembers.AbstractMoveStaticMembersRefactoringProvider.<>c__DisplayCl ass1_0.<ComputeRefactoringsAsync>b__0(SyntaxNode m)
at System.Collections.Immutable.ImmutableArray.CreateRange[TSource,TResult](ImmutableArray`1 items,Func`2 selector)
at async Microsoft.CodeAnalysis.MoveStaticMembers.AbstractMoveStaticMembersRefactoringProvider.ComputeRefacto ringsAsync(<Unknown Parameters>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync(<Unkn own Parameters>)
I am given 3 choices. I can enable the provider. I can Enable and ignore future errors. Or I can do nothing and just continue.
Given that I really have no idea what above mentioned provider is for, or does. And given that I do not understand more than a small bit of the Stack Trace content, I have no idea what choice I should make. Thus far, I have ignored it and have not noticed any effect on the project I am working. I would prefer to deal with this.
What is this for, and can I enable it without screwing something up?
-
Apr 24th, 2023, 09:43 PM
#2
Re: Invalid Operation exception
Were you trying to do something specific at the time? It's basically VS trying to help you organise your code so you don't have to do everything manually but something has failed along the way. When I see errors like that, I usually just enable the provider unless it happens a lot. You can enable and ignore but it means that something may not work as you expect in the future and you'll have no explanation for why. I'd enable and then pay attention to exactly what you were doing at the time if it happens again. If it does happen again, it's up to you to decide how often is too often.
-
Apr 25th, 2023, 11:48 AM
#3
Thread Starter
Fanatic Member
Re: Invalid Operation exception
I will do that. I do not know when this showed up. I just noticed it. I will keep a weather eye out.
-
Apr 25th, 2023, 09:20 PM
#4
Re: Invalid Operation exception
I typically choose Enable and ignore future errors. I hate being bugged about IDE glitches while I'm writing code. I haven't noticed any downsides to this choice yet.
-
Apr 26th, 2023, 10:25 AM
#5
Thread Starter
Fanatic Member
Re: Invalid Operation exception
I enabled the property. I have not seen anything that I can associate with that since. I assume that the condition is rectified.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|