Visual Studio @using statements get altered

22 Views Asked by At

I have a VS issue, VS2022 but it also happened in the previous version. In fact its been happening for a few years.

When I do certain operations, often moving files within VS, I find I get a load of syntax errors on build. Several razor pages, not even ones I was editing or had open have their using statements changed from:

@using System.ComponentModel.DataAnnotations
@using System.Text
@using System.Text.Encodings.Web

to

@    using System.ComponentModel.DataAnnotations
@    using System.Text
@    using System.Text.Encodings.Web

I then have to go into each file & remove the spaces. It happens fairly often. I've reported it to MS but they can't reproduce.
Anybody experienced this? Anybody got a fix?

0

There are 0 best solutions below