Configure .NET 5.0 Identity

Configure Identity services Services are added in ConfigureServices. The typical pattern is to call all the Add{Service} methods, and then call all the services.Configure{Service} methods. Test Identity The default web project templates allow anonymous access to the home pages. To test Identity, add [Authorize]: Sources: https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-5.0&tabs=visual-studio

.NET Identity Database v5.0.0

Run the following in Package Manger Console to create the Identity Tables to a new database. You will get an error if the tables already exist from a previous version. PM> Update-Database Identity Database v5.0.0 Tables AspNetRoleClaims AspNetRoles AspNetUserClaims AspNetUserLogins AspNetUserRoles AspNetUsers AspNetUserTokens DeviceCodes PersistedGrants

Microsoft Announces .Net 5 – A Brief Overview

During the Microsoft Build 2019, the Microsoft Team announced that .Net 5 is on its way out, and it would be arriving in 2020. This will be the next huge release after the .Net Framework latest version 4.8. .Net Framework is 17 years old and there are millions of apps built on it, by using every... » read more

EF Core tools version is older than that of the runtime

Error: Getting the following error in NuGet Package Manager Console … The EF Core tools version '3.1.3' is older than that of the runtime '3.1.5'. Update the tools for the latest features and bug fixes. Fix: Run the following in NuGet Package Manager Console … Install-Package Microsoft.EntityFrameworkCore -Version 3.1.5Install-Package Microsoft.EntityFrameworkCore.Tools -Version 3.1.5 Note: Make sure... » read more

The type or namespace name ‘ServiceContractAttributeAttribute’ does not exist in the namespace ‘System.ServiceModel’

Error: After generating a connected service from WCF, you get the following error during compile… The type or namespace name ‘ServiceContractAttributeAttribute’ does not exist in the namespace ‘System.ServiceModel’ Fix: Add the following from NuGet… System.ServiceModel.Primitives System.ServiceModel.Http Sources: https://stackoverflow.com/questions/45545013/system-servicemodel-not-found-in-net-core-project

Send .NET App Email via Gmail

Error: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. Fix: Step (1): smtp.EnableSsl = true; if not enough: Step (2): “Access for less secure apps” must be enabled for the Gmail account used by the NetworkCredential using google’s settings page:

.NET Framework vs .NET Core vs .NET Standard

.NET Framework .NET Framework is a framework for building and managing the Windows and Web-based application. This is old framework created by Microsoft and provides end to end solution to create Windows application generally known as Win Forms and Web Application like Asp.Net or Asp.Net MVC application. .NET Core .NET CoreĀ is a free, cross-platform, open... » read more

Microsoft Distributed Transaction Coordinator (MSDTC)

MSDTC is an acronym for Microsoft Distributed Transaction Coordinator. As the name says, MSDTC is a Windows service providing transaction infrastructure for distributed systems. In this case, a transaction means a general way of structuring the interactions between autonomous agents in a distributed system. The Microsoft Distributed Transaction Coordinator service is a component of modern versions of... » read more

Simple WCF Application

When you create a WCF application in Visual Studio. The project creates 2 classes for you. It also link it to the WCF Test Client. Interface and Data Contract class (.cs) Both Interface and Data Contact. The Data Contact can be its own separate class. Service Class (.svc) Implements IService1 Interface. WCF Test Client