Configuring ASP.NET Framework Version And Customizing Default Port Number In ASP.NET Core Application

Procedure to change the ASP.Net Core version in project.json file

If you observe the highlighted block of code which I give below and have commented, the commented block of codes are default framework configurations. To configure our required framework versions, we have to modify the default configuration setting, as highlighted below.

  1. {  
  2.   "dependencies": {  
  3.     //"Microsoft.NETCore.App": {  
  4.     //  "version": "1.0.1",  
  5.     //  "type": "platform"  
  6.     //},  
  7.     ---------------  
  8.     ---------------  
  9.     ---------------  
  10.   
  11.   //"frameworks": {  
  12.   //  "netcoreapp1.0": {  
  13.   //    "imports": [  
  14.   //      "dotnet5.6",  
  15.   //      "portable-net45+win8"  
  16.   //    ]  
  17.   //  }  
  18.   //},  
  19.     
  20.   "frameworks": {  
  21.     "net461": {}  
  22.   },  
  23.   ------------  
  24.   ------------  
  25.   ------------  
  26. }  

Screenshot for the reference is given below.

ASP.Net Core

Procedure to change the default port number

We know that ASP.NET Core Application runs under Kestrel Server with default port number http://localhost:5000.

Screenshot for the reference is given below.

ASP.Net Core

To change the default port number with our own host address or IP address, we have to register the configuration in Program.cs file, as shown below.

ASP.Net Core