Visual Studio 2022 not showing syntax errors and Intellisense is not working properly
Asked Answered
S

9

7

Working on a project I made a class with properties and when I tried to auto-generate a class constructor I got an error saying something on lines of "auto generation of class constructor failed... and will be disabled" and ever sense then the "generate constructor" option has been taken off the Refactor menu and on top of that I don't get syntax error highlighting anymore and intellisense doesn't seem to be working proper or at all.

I tried using going into Tools > Options > Text Editor > various fields including "C#" and "general") and I don't see anything obviously wrong. I also tried to use Visual Studio Installer to try to repair and that didn't do anything. I am completely out of ideas and I can't find anything that is remotely close to my case. TIA

Scopophilia answered 26/4, 2022 at 5:2 Comment(2)
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer.Guyenne
I found that intellisense sometimes does not work (something somewhere is crashing?). If I close my VS and restart it comes back.Spillway
L
12

I can't add this reply as a comment as I don't have 50 reputation.

I created a .Net 6.0 C# console project in Visual Studio 2022, add a class, and add two private fields. Selecting these two fields, press Alt+Enter to quickly generate the constructor. I did not encounter your issue.

Please try:

  1. Go to Visual Studio Installer, click Modify, uncheck IntelliCode in Individual components, then click Modify button to save the change, wait for the installation to complete, and then reinstall IntelliCode.
  2. In Visual Studio, go to Tools->Options->IntelliCode to check if the setting is Default.
Lindeman answered 27/4, 2022 at 8:27 Comment(8)
So this worked for getting my IntelliCode working so now I am getting suggestions as I type but I am still having a problem that I am not getting the red squiggly line under problem code or like missing semi-colons. Do you have any suggestion on how to get that back up and running or reinstalled? Or what that feature might be called? Thanks!!!Scopophilia
Please check Tools->Options->Text Editor->General->Show Error squiggles.Lindeman
okay, so that check box is checked and it still isn't working. I tried unchecking rechecking and various other unchecking/rechecking combinations and still nothing worked :/Scopophilia
Please try to fix Visual Studio in Visual Studio Installer, If the issue still exists, please run /safemode at the development command prompt, it will check if third-party packages and extensions are causing the issue.Lindeman
I already tried running fixing it with the installer. I tried "repairing" and I tried uninstalling and reinstalling and they didn't work. I also don't have an extensions install and I am using Visual Studio as default. I honestly don't know how to use safemode confidently enough to really do it or know what to look for. If it's as simple as just running safemode and seeing if everything works that I could do that but beyond that I have no clue.Scopophilia
Please reset all settings, close Visual Studio, then run /SafeMode in the Developer Command Prompt.Lindeman
okay so I thought that I should pass this info on. I recently submitted my issue with Microsoft Developer Community and it turns out this was an actual bug and it seems it kept getting escalated until it finally got to the people that patched it and I believe they said the fix will be in the next patch. If you want to check out the post I will leave a link. THANK YOU EVERYONE FOR YOUR HELP AND INPUT I GREATLY APPRECIATE IT!!! link to post on Microsoft developer community regarding this issueScopophilia
This worked for me too. I reset all settings, did a repair, and uninstalled and installed visual studio 2022. Finally, after removing Intellicode from the Visual studio installer, it works. Thank you.Uncouth
H
4

This might happen If you use the ReSharper extension trial version and it is expired.

To fix this:

  • Navigate to Extensions menu-> Manage Extensions in visual studio.

  • From the left side bar -> navigate to installed.

  • From the right side look for "JetBrains Resharper ..." and disable it.

  • Close the dialog.

  • Close all Visual studio opened windows.

  • Open one of your project again.

  • Navigate to Tools menu-> option.

  • From the left side -> Text Editor.

  • For C# developers -> Navigate to C# ->

  • In General -> Uncheck "Auto list members" and check it again.

  • In intelliSense -> check/ (uncheck and check them again if it is already checked) the following:

  • "Show completion list after a character is typed"

  • "Automaticall show completion ...."

  • "Highlight .."

  • "Show completion item filter"

  • "Show name suggestions"

Refer to the following screenshots

I hope it help.

enter image description here

enter image description here

Hertzfeld answered 16/8, 2023 at 11:35 Comment(0)
P
3

Tools/Import and export settings/Reset all settings

this procedure worked for me

Punic answered 28/5, 2023 at 22:6 Comment(1)
Only thing that worked for me.Inconveniency
A
3

i had same issue , i tried multiple solution, nothing worked and i finally i found that the reason for this issue is i was opened 'folder' file in visual studio instead of 'Sln' file. so simply opening of 'Sln' file will solve the issue.

Arzola answered 14/1 at 7:5 Comment(0)
C
1

Go to Tools menu, and select Options. Under Intellicode select General. Just uncheck “C# Suggestions”. Then restart Visual Studio and check that intellisence and syntax errors are appearing.

Note, I was not able to figure out what this option does, as the C# code suggestions seemed to continue to work as expected.

Catchfly answered 4/11, 2022 at 19:11 Comment(0)
T
1

Adding this because I came here via google and this is a less nuclear action to take than reinstalling intellisense and Visual Studio.

enter image description here

Check Tools > Options... > Text Editor > General. In my case I had unchecked "Show error squiggles" and had forgotten I had done this.

Tracery answered 21/2, 2023 at 18:13 Comment(0)
F
0

I don't get syntax error highlighting anymore and intellisense doesn't seem to be working proper or at all

I got a similar problem while adding a controller in Visual Studio 2022. The .csproj file had the following Compile.Remove entry after adding the controller.

<ItemGroup>
  <Compile Remove="Controllers\..." />
</ItemGroup>

Deleting <Compile Remove="Controllers\..." /> fixed the intellisense.

Figurine answered 21/11, 2023 at 12:52 Comment(0)
J
0

The only thing that worked for me was:

  1. Closing Visual Studio
  2. Deleting the .vs, obj, and bin folders in the project
  3. Open Visual Studio again
Jameyjami answered 23/8 at 7:12 Comment(0)
T
-9

step 1 - uninstall visual studio
step 2 - upgrade to windows 11
step 3 - install visual studio

this works for me

Tidemark answered 2/3, 2023 at 13:31 Comment(2)
This appears to be more of a workaround nuclear option than an actual way to address the issue. Like "it's too hot in my house" - go to the Arctic Circle and pitch a tent there.Ochone
This isn't a valid answer. You're telling to upgrade whole OS just because of a problem related to an IDE.Varistor

© 2022 - 2024 — McMap. All rights reserved.