.NET Core MVC Page Not Refreshing After Changes

In ASP.NET Core 3.0 and higher, RazorViewEngineOptions.AllowRecompilingViewsOnFileChange is not available. Surprised that refreshing a view while the app is running did not work, I discovered the following solution: Add Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation NuGet package to the project Add the following in Startup.cs: services.AddControllersWithViews().AddRazorRuntimeCompilation(); Here’s the full explanation for the curious.

.NET Core DI, ways of passing parameters to constructor

The expression parameter (x in this case) of the factory delegate is an IServiceProvider. Use that to resolve the dependencies: _serviceCollection.AddSingleton<IService>(x => new Service(x.GetRequiredService<IOtherService>(), x.GetRequiredService<IAnotherOne>(), “”)); The factory delegate is a delayed invocation. Whenever the type is to be resolved, it will pass the completed provider as the delegate parameter.

Using ‘UseMvc’ to configure MVC is not supported while using Endpoint Routing

I found the solution, in the following official documentation “Migrate from ASP.NET Core 2.2 to 3.0”: There are 3 approaches: Replace UseMvc or UseSignalR with UseEndpoints. In my case, the result looked like that public class Startup { public void ConfigureServices(IServiceCollection services) { //Old Way services.AddMvc(); // New Ways //services.AddRazorPages(); } public void Configure(IApplicationBuilder app, … Read more

How to run .NET Core console application from the command line

If it’s a framework-dependent application (the default), you run it by dotnet yourapp.dll. If it’s a self-contained application, you run it using yourapp.exe on Windows and ./yourapp on Unix. For more information about the differences between the two app types, see the .NET Core Application Deployment article on .NET documentation.

.NET Standard vs .NET Core

I will try to further clarify your doubts and extend Jon Skeet answer. .NET Standard is a specification, so a library compiled for a specific .NET Standard version can be used in different .NET Standard implementations. As said in my other comment, a good analogy for the relationship between .NET Standard and other .NET Standard … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)