简体   繁体   中英

Code generation "Quick Actions" in Visual Studio 2022 no longer working in C#

Typically when I implement an interface or write code for which usings are missing it is possible to press Ctrl+. (or right click and press 'Quick Actions and Refactorings...') to get a menu of suggestions on what can be done.

Among these suggestions are options to 'implement the interface' which generates stubs for the required methods/properties or 'add usings' etc.

These are no longer available to me. Various other actions are but afaik the common theme of those not being available any longer are the ones that in one way or another generates code.

None of my colleages have the same problem. I do however have the problem on ALL computers on which my account is logged into Visual Studio. So it clearly has something to do with my settings that are synced.

  • I have tried resetting the settings.

  • I have tried reinstalling VS.

  • I have tried to change various settings according to various slightly related tips on different forums which addresses similar issues.

  • I have checked the roslyn log files for any information on something going wrong.

But so far nothing helps.

I've searched various forums and it seems like ppl have experienced the same or similar issues throughout the years but I am unable to find any thread where anyone has actually found the cause of it nor a solution.

I can't say for sure but I think this started when upgrading from 17.3 to 17.4.

Worth mentioning might be that it actually still works in Visual Basic.

There seems to be no difference if it is .NET FW, Core or 6+.

Has anyone experienced something similar and have any suggestions on what can be done to fix it?

Thanks!

Based on my testing, VS 2022 community 17.4.4 still be able to use the 'implement the interface' feature:

在此处输入图像描述

在此处输入图像描述

From your description, looks like if you don't sign in, everything will be ok.

So here are two solutions:

1, Reset the settings of the C#:

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

2, Turn off synchronized settings on a particular computer

Otherwise reinstall the VS will be meaningless

在此处输入图像描述

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM