Results 1 to 5 of 5

Thread: [RESOLVED] Invalid Operation exception

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    Resolved [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?

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    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.

  4. #4
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    9,017

    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.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2011
    Location
    Oregon City, Oregon
    Posts
    705

    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
  •  



Click Here to Expand Forum to Full Width