Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

217
Views
Bad auto formatting in razor page file for <text> blocks - VS2022

In a razor page file (.cshtml), when I use for example ; or {, in @<text> block or anything except for razor syntax, then the file is auto-formatted, the same as if I use Ctrl+K+D.

The issue is that EACH time my file is formatted, EVERY content inside a @<text> block will be indented.

Example:

.OnDone(@<text>
    foo();
 </text>)

after writing the second ; it became (and all other @<text> block in my file)

.OnDone(@<text>
        foo();
        foo2();
</text>)

I already deactivated the option Use adaptative formatting. I tried in Options > Text Editor > JavaScript/TypeScript > Formatting and unchecked everthing in Automatic Formatting but without success.

Important to mention that this behavior is only in VS2022 and not in VS2019.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!