'Where is the Program.cs or Startup.cs file in asp.net?
I am trying to do an online library(as in an online book store) using ASP.NET MVC. I can't find the Program.cs file or the Startup.cs file.
I tried manually creating the Program.cs file but when I write the line
var builder = WebApplication.CreateBuilder(args);
it does not find the WebApplication class.
I tried adding
using Microsoft.Graph;
but then I get another error:
WebApplication' does not contain a definition for 'CreateBuilder
What should I do?
Solution 1:[1]
Serge made a good point in the comments. Based on your notes, it looks like you have created a .NET 4 project. What you want to do is recreate your project as an ASP.NET Core web app (.NET 5 or higher). Program.cs will then be created automatically.
.NET 4 and 5 are completely different under the hood, so this distinction is important. Rather than being an iteration, the latter was written from the ground up to be more scalable and support concepts like multiple platforms, microservices, and containers.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
