Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate characters when typing in VS 2022 .cs page

I am typing only once a character but it automatic creates its duplicate.

In .cs or .vb code area whenever i type something it gets double.

example a will be aa if will be iiff

Even if I type enter it will add two lines instead of one and backspace and other keys are working in same manner.

When I am typing in .aspx page or anywhere else my keyboard works fine.

I tried few things to solve this like:

  1. code clean up, build, rebuild
  2. restart visual studio and pc

But still facing the same.

like image 890
Himanshu Aggarwal Avatar asked Nov 26 '25 20:11

Himanshu Aggarwal


2 Answers

I had a similar issue in a .cshtml file. I discovered that I was trying to add a jquery event underneath a method that contained an @ symbol (which is used to switch between markup and code). In this case it was @Url.Action. My workaround was to move the method containing the @Url.Action to the bottom of the script block and I was then able to type freely above it without any duplicate characters.

e.g. With @Url.Action above my code: Duplicate characters appearing in

With @Url.Action below my code: enter image description here

like image 86
Paul H Avatar answered Nov 29 '25 10:11

Paul H


Just do a repair on vs. This issue has cropped up over the years - even with previous versions. So, repair your install.

you can go tools->get tools and features.

You then get this:

enter image description here

Close above screen, and then you see this:

enter image description here

And from above, choose this:

enter image description here

so, usually a repair should fix this issue.

I suppose it possible you are remoting into the computer - and that could be a issue, but I suggest the above as a first step here.

Edit: Try this if the issue is ONLY for HTML editing

Go to settings, from Setting select Options, from Options select Text Editor, from Text Editor Select HTML, from HTML Select General, from General Disable Auto List Members. A change of this setting has been confirmed to be a fix.

like image 41
Albert D. Kallal Avatar answered Nov 29 '25 09:11

Albert D. Kallal



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!