Unable to configure HTTPS endpoint. No server certificate was specified, and the default developer certificate could not be found
These instructions from this blog worked for me dotnet dev-certs https –clean dotnet dev-certs https –trust Restart VS
These instructions from this blog worked for me dotnet dev-certs https –clean dotnet dev-certs https –trust Restart VS
In the ConfigureServices() method of the Startup class, Set options.CheckConsentNeeded = context => false; as follows: services.Configure<CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => false; // Default is true, make it false options.MinimumSameSitePolicy = SameSiteMode.None; });
Calling the Dispose method is not required but you can still call it if you need for some reasons. Proof: HttpClient and lifetime management Disposal of the client isn’t required. Disposal cancels outgoing requests and guarantees the given HttpClient instance can’t be used after calling Dispose. IHttpClientFactory tracks and disposes resources used by HttpClient instances. … Read more
In the Startup.cs, remove the middleware app.UseHttpsRedirection();
This solution works on IIS 10+ version and allows to remove x-powered-by and server headers in server response. In IIS 10 a new attribute was added: removeServerHeader. We need to create web.config file in asp.net core application with following content: <?xml version=”1.0″ encoding=”utf-8″?> <configuration> <system.webServer> <security> <requestFiltering removeServerHeader=”true” /> </security> <httpProtocol> <customHeaders> <remove name=”X-Powered-By” /> … Read more
Static files, such as HTML, CSS, images, and JavaScript, are assets an ASP.NET Core app serves directly to clients. Some configuration is required to enable serving of these files. UseStaticFiles – Serve files inside of web root (wwwroot folder) UseSpaStaticFiles – Serve static file like image, css, js in asset folder of angular app UseSpa … Read more
ASP.NET Core 2.1 introduced new feature called Razor class libraries that lets you build views and pages as part of reusable library. ASP.NET Core Identity was moved to such RCL. You can override it in your project: From Solution Explorer, right-click on the project > Add > New Scaffolded Item. From the left pane of … Read more
Working on this answer lead me to multiple answers. I think the first approach is what you are looking for, the second is a good alternative. In order to configure multiple clients you can use named clients. These clients are registered as transient. Use DI to get the service that has access to the request … Read more
You cannot do this with an attribute because they are just meta information generated at compile time. Just add code to the constructor to initialize the date if required, create a trigger and handle missing values in the database, or implement the getter in a way that it returns DateTime.Now if the backing field is … Read more
Great news… In ASP.NET Core 2 and up, you don’t need a custom ViewEngine or even ExpandViewLocations anymore. Using the OdeToCode.AddFeatureFolders Package This is the easiest way… K. Scott Allen has a nuget package for you at OdeToCode.AddFeatureFolders that is clean and includes optional support for areas. Github: https://github.com/OdeToCode/AddFeatureFolders Install the package, and it’s as … Read more