Visual Studio 2019 Community Edition is a full feature development environment for application development.
- the community edition is free for commercial apps subject to the licensing terms and conditions. Paid versions Visual studio professional and enterprise editions are also available
- supports numerous development languages including F#, C#, VB.net.
- numerous project templates for getting started with different types of apps and services including apps for Mobile, Web windows forms, console, and more
- Extensions and Addins can be installed to increase productivity, generate source code, add support for vendor-specific products, etc.
- extensive refactoring support
- extensive debugging capabilities
- access servers, databases, etc directly within VS IDE
Let’s take a quick look at what features the default web application project template provides.
Web App Template options
Configuration options include
- .NET runtime version
- web-app type/technologies
- user authentication options include Individual (web forms), windows, work or school accounts, or none
Note: Many of the project templates can be generated directly using the dotnet new command with command-line switches. e.g, dotnet new mvc –auth Individual
We need to review the database connection string in the file appsettings.json and update if needed.
We can then run the Package Manager entity framework command update-database to create the database and tables.
Run Web App
We can then run the Web App and select the top menu option Register.
The template requires a unique Email address
In a real registration process, an email requesting confirmation is sent to the user however this code needs to be implemented.
In the template the webpage provides the option to confirm the account.
We can now select the login screen.
Account lockout on incorrect password is not implemented in the default template but can easily be added.
The login screen also includes a checkbox for Remember me and Forgot password functionality
The template supports Social logins although some configuration is required in order to implement that feature.
Account Settings (User profile)
The template already provides several account management features.
- change email address
- edit phone number
- change password
- external logins
- Two-factor authentication (2FA)
- download and delete personal data
Two-Factor Authentication (2FA)
Wheres the source code?
By default much of the template source code is loaded from a referenced NuGet package Identity and not included in the project.
The code for one or more pages can be extracted via the solution explorer context menu.
Implementing Account lockout
This feature is available but not implemented by default. To implement we need to extract the source code for Login.cshtml.cs as above and modify the call to _signInManager.PasswordSignInAsync( setting the final parameter lockoutOnFailure to true.
We can customize the number of attempts etc by adding code to Startup.cs
The default web app template provides many of the account management features to get started building a typical web application. It does not include an admin UI to manage user accounts.