VS 2022, I can't drag and drop css file into a cshtml file

Viewed 2430

I am working with VS2022 ASP.NET Core 6 MVC.

I tried to drag & drop one CSS file from explorer to a .cshtml file. It should be made automatically like this code the same way-VS 2019

<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />

But prohibition icon shown when I am trying the drag & drop operation.

I started again VS 2022 with Administrator permissions, but it's still the same situation.

Any idea?

2 Answers

There is a work around suggested by Microsoft: Tools-->Options-->Text Editor-->HTML-->Advanced-->Use Legacy Razor Editor for Asp.NET (Yes) -->OK

Related