System.InvalidOperationException | IServiceCollection.AddRazorPages | Resolved
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: 'Unable to find the required services. Please add all the required services by calling 'IServiceCollection.AddRazorPages' inside the call to 'ConfigureServices(...)' 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: [email protected] ================================================== Audio Used in Video: The Coldest Shoulder Credits: YouTube free music library ==================================================
Download
0 formatsNo download links available.