System.InvalidOperationException | IServiceCollection.AddRazorPages | Resolved

Аватар автора
Java Сообщество
In this video I have resolved the following error that you might face while making an application in asp.net mvc and using Razor Pages in your application. The error is: System.InvalidOperationException: &to find the required services. Please add all the required services by calling &inside the call to &in the application startup code.' The solution is very simple: You need to add builder.Services.AddRazorPages(); After builder.Services.AddControllersWithViews(); in your program.cs or startup.cs class. I am using .net 6.0 so I have only Program.cs class. In previous versions, like 5.0 or 3.1 you need to add this in startup.cs class. ================================================== Thanks for watching, Please subscribe my channel. ================================================== If you have any questions or queries, write them in comments below or mail me at: ================================================== Audio Used in Video: The Coldest Shoulder Credits: YouTube free music library ==================================================

0/0


0/0

0/0

0/0