Home > database >  Adding Javascript file to MVC Project in VS 2022
Adding Javascript file to MVC Project in VS 2022

Time:03-24

I have migrated my project from VS 2017 to VS 2022,
And I have a strange problem:

When attempting to add a new .JS file to the scripts folder I don't have the option to select .JS file in the "Add New Item" menu (via right-click on scripts folder), only .TS or .JSON:

enter image description here

Tried "playing" with it and searching but did not find any solution.
can someone please tell me what am I missing?

CodePudding user response:

This depends on one thing that is if you installed all required modules for Visual Studio 2022.

The basic thing here is to Right-Click on any directory/folder in the Solution Explorer window, Select Add and then New Item. You then click on the Language you are programming in. Note: if you don't click this folder, the options you may see would be only for the selected folder.

See below images... Adding a JS file

Where the file is added.

  • Related