- Go to Visual Studio Download
- Download Visual Studio Community/Professional/Enterprise (Latest version)
- Run the installer and select the following workloads:
- ASP.NET and web development
- .NET Core cross-platform development
- Click Install and wait for the installation to complete.
- Restart your system if prompted.
- Visit Download .NET
- Download and install the latest .NET SDK (LTS version recommended).
- Verify installation:
- Open Command Prompt or PowerShell
- Run:
dotnet --version - If installed correctly, it will display the version.
- Download SQL Server:
- Go to SQL Server Download
- Select Developer Edition (Free for development and testing)
- Run the installer and choose Basic Installation
- Complete the setup and note down the server name
- Download SSMS:
- Go to SSMS Download
- Install and open SSMS
- Connect to SQL Server using Windows Authentication
- Open Visual Studio
- Click Create a new project
- Select ASP.NET Core Web App and click Next
- Enter a Project Name, select a Location, and click Create
- Choose .NET version, select Razor Pages / MVC / API
- Click Create
- Open Program.cs and Startup.cs (if available)
- Click the Run Button (IIS Express / Kestrel)
- The project will open in your default browser
- Verify that the ASP.NET web page is running
- Open
appsettings.json - Add the SQL Server connection string:
"ConnectionStrings": { "DefaultConnection": "Server=YOUR_SERVER_NAME;Database=YOUR_DB_NAME;Trusted_Connection=True;" }
- Replace
YOUR_SERVER_NAMEwith your SQL Server instance name. - Replace
YOUR_DB_NAMEwith your database name.
- Open Visual Studio Package Manager Console
- Run the following commands:
Install-Package Microsoft.EntityFrameworkCore.SqlServer Install-Package Microsoft.EntityFrameworkCore.Tools
- Open Package Manager Console
- Run:
Add-Migration InitialCreate Update-Database
- Verify that the tables are created in SSMS.
- Click Run in Visual Studio
- Open SSMS, select your database, and check if data is being stored
- Test endpoints (if using API) with Postman or Swagger
- Right-click on the Project in Solution Explorer
- Select Publish > Folder
- Choose a location and click Publish
- Install IIS via Windows Features
- Add ASP.NET Core Hosting Bundle (Download)
- Deploy your project to IIS using Web Deploy