Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 Snippets not working for C#

I did a fresh install of Visual Studio 2022 v17.0.0 (.NET 6.0) and created a new WebAssembly project. Tried editing Counter component but none of the snippets work for C#.

Typing cw is supposed to bring up Console.WriteLine but nothing happens, tabbing does nothing but insert tabs. Tried several other snippets and same results. If I enter Console. I should get suggestions popping up but I get nothing.

I tried doing a repair installation but didn't fix the problem. Any suggestions as to what else I can try to fix. Thanks

like image 625
user1068557 Avatar asked Dec 06 '25 01:12

user1068557


1 Answers

Most likley it is functioning but I found that VS 2022 made som changes to the default behaviour.

Make sure that when you type your phrase in the the document that it is appearing on top of the suggestion box. Example showing suggestion

If not press ctrl + alt + space. Try again. Example not showing suggestion

If you are experiencing that the phrase you are typing is not default selected when you try to tab out your snippet you may want to change your IntelliSense behaviour from 'Include snippets when ?- Tab....' to 'Always include snippets'.

Tools > Options > Text Editor > C# > IntelliSense > 'Always include snippets'

Best of luck, fingers crossed, godspeed and all that. =)

like image 140
kejsarn Avatar answered Dec 08 '25 14:12

kejsarn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!