How to add a Web Form .aspx file in Visual Studio 2022
In the process of building an IIS web app today, I got stuck for 20 minutes while trying to add a Web Form .aspx file. Turns out you need to an extra .NET Framework template that isn’t installed by default in newer versions of Visual Studio.
To resolve this issue:
- Go to the VisualStudioSetup.exe and select “Modify.”
- Under “Web and Cloud”, select ASP.NET and Web development.
- Under Installation Details > Azure Development > Optional, select .NET Framework project and item templates.
Install the new template.
Then, create a new ASP.NET Web Application.
- Add Web Forms
- Click Solution > Add > New Item > select Web Form, and add the .aspx file.