Step by step migration of ASP.NET Core 2.2 to 3.1

In order to upgrade/migrate asp.net core version to 3.1 following steps to be perform.
Download and install Visual Studio 2019 version 16.4 or higher.Download and install .NET Core 3.1  https://dotnet.microsoft.com/download/dotnet-core/3.1Upgrade the projects of solution to .NET Core 3.1 , because ASP.NET Core 3.1 requires it.Update existing Nuget packages to a version compatible with ASP.NET Core 3.1 in each projectUse IHost interface from a IHostBuilder instead of building and running a IWebHost from a IWebHostBuilder in Program.cs public static IHostBuilder CreateWebHostBuilder(string[] args) => Host.CreateDefaultBuilder(args) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseKestrel() .UseSerilog() .UseStartup<Startup>(); }) Change AddMvc method has been replaced by AddControllers in Startup.cs of each projects.In Startup.cs,UseMvc method to be replaced by…

Regular expression for validating URL in Javascript

I was looking for a decent regular expression to validate URLs that were entered as user input with.
After lots of searching on google i got the perfect solution which satisfy my requirement of my current assignment
Following is the regular expression for validating URL (Valid URL Regular Expression) a have used which worked perfectly.

^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$

Following is the pattern results for the same
  • https://www.test.com   -Passed
  • http://www.test.com   -Passed
  • www.test.com   -Passed
  • test.com   -Passed
  • http://blog.test.com   -Passed
  • http://www.test.com/product   -Passed
  • http://www.test.com/products?id=1&page=2   -Passed
  • http://www.test.com#up   -Passed
  • http://255.255.255.255   -Passed
  • 255.255.255.255   -Passed
  • http://invalid.com/perl.cgi?key= | http://web-site.com/cgi-bin/perl.cgi?key1=value1&key2   -Failed
  • http://www.site.com:8008   -Passed

Comment if you like it!!

Comments

Popular posts from this blog

Restore the lost focus of Auto post back controls in asp.net update Panel control

Add Comma automatically while entering amounts in textbox using Javascript

Devexpress Datebox date formatting in angular 6 with example