Store does not implement IUserRoleStore ASP.NET Core Identity

In Startup.cs, I was missing AddRoles so services.AddDefaultIdentity<PortalUser>() .AddEntityFrameworkStores<ApplicationDbContext>(); should be services.AddDefaultIdentity<PortalUser>() .AddRoles<IdentityRole>() .AddEntityFrameworkStores<ApplicationDbContext>(); Note: The order is critical. AddRoles must come before AddEntityFrameworkStores

Best way to force an update of a transitive nuget package dependency?

The best way to force an update of a transitive Nuget package dependency is to update the directly referenced package to a newer version that includes the updated transitive dependency Open the Package Manager Console in Visual Studio. You can do this by going to Tools > NuGet Package Manager > Package Manager Console. Run … Read more

Convert .Net Framework 4.6.2 project to .Net core project

This appears to be an official Microsoft resource for doing the migration. Summarized below: (recommended) Retarget all projects you wish to port to target the .NET Framework 4.7.2 or higher. (recommended) Use the .NET Portability Analyzer to analyze your assemblies and see if they’re portable to .NET Core. (recommended) Install the .NET API analyzer into … Read more

What is the new GlobalSection in a VS2017 15.3 solution file?

According to Mastering Visual Studio book the ExtensibilityGlobals (and ExtensibilityAddIns) section included for the benefit of add-in authors. ExtensibilityGlobals used to store global information about the solution. So it is clearly generated by(or for) some 3rd party tools. The only discussion about SolutionGuid is here, which is generated by CMake and they advise that you … Read more

The “correct” way to create a .NET Core console app without background services

Instead of a hosted service, I would recommend the following; using (var host = CreateHostBuilder(args).Build()) { await host.StartAsync(); var lifetime = host.Services.GetRequiredService<IHostApplicationLifetime>(); // do work here / get your work service … lifetime.StopApplication(); await host.WaitForShutdownAsync(); }

How to run a .Net Core dll?

Add this to your project.json file: “compilationOptions”: { “emitEntryPoint”: true }, It will generate the MyApp.exe on Windows (in bin/Debug) or the executable files on other platforms. Edit: 30/01/2017 It is not enough anymore. You now have the possibility between Framework-dependent deployment and Self-contained deployment as described here. Short form: Framework-dependent deployment (.net core is … Read more

Is launchsettings.json in a dotnet core project used in production?

The launchSettings.json file is only used by Visual Studio during debugging and when running the app via dotnet run command. See the quote from the official documentation: The launchSettings.json file: Is only used on the local development machine. Is not deployed. contains profile settings. So for everyone who is looking for the short confirmed answer: … Read more