Visual Studio 2022 - Add HTML file and Add Javascript File options are not available

Viewed 580

I have upgraded to VS 2022 recently. Now in the solution explorer, when I right-click a folder and want to add an HTML file or javascript file, the options are not available in the context menu. This was available in the earlier version.

Is there a way to get this option back?

2 Answers

This option seems to show up for Web startup projects, but not for library projects.

As a workaround, I created my own template. You can place this file in "...\Documents\Visual Studio 2022\Templates\ItemTemplates\JavaScript"

For those who want to make it from scratch, see How to: Create item templates. I grabbed the icon from here.

Yes, you can add it from menu. Go to File > New > File > Choose Html/Js File. Or press Ctrl + N => to create a new file.enter image description here

Related