Sam
Sam

Reputation: 5647

.Net 6.0 console application keeps displaying popup message while I am trying to code

I am typing in an example from the book, "C# 10 and .Net 6".

It is a console application with reflection.

Here is the code so far:

using System.Reflection;

Assembly? assembly = Assembly.GetEntryAssembly();
if (assembly == null) return;

// Loop through the assemlies that this app references
foreach (AssemblyName name in assembly.GetReferencedAssemblies())
{
    // Load the assembly so we can read its details
    Assembly a = Assembly.Load(name);

    // declare a variable to count the number of methods
    int methodCount = 0;

    // loop through all the types in the assembly
    foreach (TypeInfo t in a.DefinedTypes)
    {
        // add up the counts of methods
        methodCount += t.GetMethods().Count();
    }

    //
}

I got this far and was about to type in the last part and I got the popup dialogue in the pic:

enter image description here

It says: Specified argument was out of the range of valid values. Parameter name: length

Why does this obtrusive popup keep displaying and stopping me from typing? What is it? What does it mean? Why does it not wait for you to try and build, compile or run before reporting the problem.

What is this and how do you make it go away?


I just want to add I was able to type it all in and the example runs correctly. But why does VS 2022 keep displaying this popup while I am trying to type?

Upvotes: 0

Views: 198

Answers (1)

tmaj
tmaj

Reputation: 35037

This looks like a problem with Visual Studio or an extension. It's not a problem with your code.

You could try:

  1. Restarting VS,
  2. Restarting Windows,
  3. Repairing/updating/reinstalling VS.

Upvotes: 1

Related Questions