C
C#2y ago
bgb37

✅ No default Startup.cs file ASP.NET Core Project

Hello all, I am trying to follow an Entity Framework Tutorial. But the problem i face all the time is that i don't get the same default files and folders that the tutor has. Probably related to the difference of the Visual Studio Versions that we use but not sure. I've faced this problem couple of times and i want to know what is it that i am doing wrong.
Tutor has a Startup.cs file but i don't have it. Related Tutorial Video: youtube.com/watch?v=qkJ9keBmQWo&t=7944s Time: 16.12 My file Structure is in the image. I am using Visual Studio 2022 version 17.4.5
12 Replies
Pobiega
Pobiega2y ago
In more recent versions of .NET, you simply get Program.cs The new ASP pipeline is designed around this and the new hostbuilder syntax just doesn't need a dedicated startup file the way the old one did
bgb37
bgb37OP2y ago
Ok. So if i put the same codes that the tutor writes inside the Startup.cs file to my Program.cs file, would it work?
Pobiega
Pobiega2y ago
more or less
bgb37
bgb37OP2y ago
🙂
Pobiega
Pobiega2y ago
there are some changes. For example, Startup used to have a method called ConfigureServices in the new hostbuilder thats just a lambda
bgb37
bgb37OP2y ago
It is so bad that everthing changes so fast. I can not even follow a tutorial
Pobiega
Pobiega2y ago
Might seem that way, but I think its good it means the language and our tools are evolving and becoming better
bgb37
bgb37OP2y ago
Yeah. Only if you know to work it around
Pobiega
Pobiega2y ago
the downside is ofc tutorials getting stale, but there are up to date tutorials, so try to find one of those instead
bgb37
bgb37OP2y ago
Ok. Thank you for your help.
Pobiega
Pobiega2y ago
I managed to google this one for example: https://www.youtube.com/watch?v=e2I7EzuCt1g
Ravindra Devrani
YouTube
Asp.net core mvc (7.0) in one video
asp .net core mvc course A Roller-coaster ride to learn asp.net core mvc 7.0 framework. After following this tutorial, you will have good understanding of web development with c# and dotnet core. You will be ready to develop your own projects. We will also implement CRUD operations in asp.net core mvc with entity framework core 7. Hit the 👍 lik...
bgb37
bgb37OP2y ago
👍🏻
Want results from more Discord servers?
Add your server