Simple Way to Setup Kestrel URLs in ASP.NET Core RC 2 – Windows ASP.NET Core Hosting 2024 | Review and Comparison

Yes… Yes… As we may know that Microsoft has just released new ASP.NET Core RC 2 version, with this RC 2 version, it will be more stable and easier to publish the application. Now, we are going to discuss more about ASP.NET Core RC 2, in this tutorial, we will show simple ways to setup Kestrel URLs in ASP.NET Core RC 2. Hope you enjoy this tutorial.

asp-net-5

How to Make It Works??

First, we must use this command bindings in project.json:

"commands": {
  "web": "Microsoft.AspNet.Server.Kestrel --server.urls=http://localhost:13560;http://localhost:13561;"
},

If no URLs were specified, a default binding of http://localhost:1157 would be used.

As of RC2 we have a new unified tool chain (the .NET Core CLI) and ASP.NET Core applications are effectively just .NET Core Console Applications. They have a single entry point where we programatically configure and run the ASP.NET hosting provider:

public static void Main(string[] args)
{
    var host = new WebHostBuilder()
        .UseKestrel()
        .UseContentRoot(Directory.GetCurrentDirectory())
        .UseIISIntegration()
        .UseStartup<Startup>()
        .Build();

    host.Run();
}

Here we’re adding support for both Kestrel and IIS hosts via the appropriate extension methods.

Upgrading your SaasKit to RC 2

When we upgraded SaasKit to RC2 we used the UseUrls extension to configure the URLs Kestrel would bind to:

var host = new WebHostBuilder()
    .UseKestrel()
    .UseContentRoot(Directory.GetCurrentDirectory())
    .UseUrls("http://localhost:13560", "http://localhost:13561")
    .UseIISIntegration()
    .UseStartup<Startup>()
    .Build();

This approach is quite complex as you must do hard coding URL. There are other best ways to load Kestrel

Other Simple Ways

First create a hosting.json file in the root of your application with your required bindings. Separate multiple URLs with a semi-colon:

{
  "server.urls": "http://localhost: 13560;http://localhost: 13561"
}

Next update Program.cs to load your hosting configuration, then use theUseConfiguration extension to pass the configuration to the WebHostBuilder:

public static void Main(string[] args)
{
    var config = new ConfigurationBuilder()
        .SetBasePath(Directory.GetCurrentDirectory())
        .AddJsonFile("hosting.json", optional: true)
        .Build();

    var host = new WebHostBuilder()
        .UseKestrel()
        .UseConfiguration(config)
        .UseContentRoot(Directory.GetCurrentDirectory())
        .UseIISIntegration()
        .UseStartup<Startup>()
        .Build();

    host.Run();
}

If you’re launching Kestrel with Visual Studio you may also need to updatelaunchSettings.json with the correct launchUrl:

"RC2HostingDemo": {
  "commandName": "Project",
  "launchBrowser": true,
  "launchUrl": "http://localhost:1157/api/values",
  "environmentVariables": {
    "ASPNETCORE_ENVIRONMENT": "Development"
  }
}

Now the web application will listen on the URLs configured in hosting.json:

Hosting environment: Development
Content root path: C:\Users\admin\Source\RC2Hosting\src\RC2Hosting
Now listening on: http://localhost:13560
Now listening on: http://localhost:13561
Application started. Press Ctrl+C to shut down.

How Can You Test This Feature?

We know it might be quite difficult to find hosting provider that support this newest ASP.NET RC 2 version as this is new version and Microsoft just released it. And how can we find the provider that support this newest feature? In our previous post, we have given one hosting provider that support this newest feature.

Now, we are going to recommend other hosting provider that support this newest feature as an alternative solution. Other great recommendation for you is HostForLIFEASP.NET. Why them? Don’t close your browser first, keep reading to find more information about them here.

Short History HostForLIFEASP.NET ASP.NET Hosting

HostForLIFEASP.NET has been running this business for many years as a provider of efficient, affordable internet services made up of shared hosting, reseller hosting, cloud hosting, dedicated server & domain registration. With a passionate team and powerful management HostForLIFEASP.NET has constantly grown over the past 6 years experiencing powerful organic growth. Through this and HostForLIFEASP.NET acquisition of other companies they host in excess of 100,000 websites across their shared and dedicated hosting platforms systems on their European network.

At first, HostForLIFEASP.NET only operates data centers in Amsterdam. Since 2012, their services growing very fast and their management decide to open data centers in London and Paris. In 2014, they opened new data center in Frankfurt, and the newest data centers is in Milan.

HostForLIFEASP.NET ASP.NET Hosting Plans and Pricing

During our HostForLIFEASP.NET review we noted that shared hosting plans are available in quarterly, yearly and 3 years payment. You do save more money by purchasing 12 or 36 months of service in advance. Three year service agreements are €3.0 per-month. One year packages are €4.50 a month, billed annually. Quarterly payments are €7.00 per-month. On HostForLIFEASP.NET, ASP.NET is available on all plans. And all of their shared hosting plan comes with unlimited hosted domains, unlimited disk space, and also unlimited bandwith.

Here are more details about their shared ASP.NET Hosting plan

  • Classic: €3.00 per-month. This is the most basic shared hosting plan. It comes with only 1 MSSQL and 1 MySQL database.
  • Budget: €5.5 per-month. This plan offers FREE domain name, just use ‘HFLDOMAIN’ as the coupon code. It also comes with 2 MSSQL and 2 MySQL databases. We use this plan as this is most suitable for our site.
  • Economy: €8.00 per-month. This plan is highly recommended for developer. It comes with rich MSSQL quota and also email accounts.
  • Business: €11.00 per-month is very suitable for business site as in this plan you can consume high memory usage on the server, FREE 1 domain name, FREE Anti virus scanner every month, FREE daily backup.

hostforlife_eu_ASPNET_Shared_Hosting_Plans

In addition to shared hosting, the company offers reseller hosting plans, cloud hosting and also dedicated server plans.

The company’s website claims that only the very fast and reliable servers are used so as to achieve a 99.9% uptime, but it never provides a guarantee for the performance.

Technical support is available through 24 x 7 e-mails support and that responsibility is delegated to its European office.

HostForLIFEASP.NET ASP.NET Hosting Uptime, Downtime, and Speed

HostForLIFEASP.NET has a guarantee on their site of 100% uptime. However, during our review we found that according to uptimerobot.com, the claim is almost accurate. Over time, this site has been monitoring HostForLIFEASP.NET, since September 2012, the hosting site experienced 28 occurrences where the servers were down. The total amount of time in those 3,000+ days was approximately 33.22 hours, or 1993 minutes to be exact. While it isn’t a horrible amount of downtime, giving the company an average uptime of 99.99%, it isn’t exactly 100% like their guarantee claims.

hostforlife response time

As for HostForLIFE’s speed, the download speed leaves something to be desired. On WebPageTest.org, a third-party site that tests webpages and host sites, their speed is really fast, it only takes around 1-3 seconds to open their site.

Powerful Hardware and Powerful Options

Additionally, a plan known as the HostForLIFEASP.NET ASP.NET hosting exists, though finding details on the plan is very sketchy.  It is possible that the plan is outgoing, and thus the lack of clear links and pricing is understandable, but the promises of faster MSSQL running on separate hardware is obviously very appealing. On the subject of appealing, HostForLIFEASP.NET’s dedicated hosting plans starting at just under €270 a year are also extremely attractive.  Powered by 2.6 GHz AMD Opteron CPUs, and packing 1 GB of memory and also 1 GB bandwith.

If the aforementioned hardware setup does not meet one’s needs, HostForLIFEASP.NET is more than happy to develop custom solutions to suit virtually any need.  Backed by generators and countless UPS solutions, the entire network infrastructure, known as Alchemy Inc., is immune to just about everything except for acts of war/terrorism, and the most devastating aspects of Mother Nature.  This is perhaps why HostForLIFe.eu offers the 100% uptime guarantee on their site, but it is important to note that all of HostForLIFE’s servers are protected, not just those in the cloud/Dedicated hosting clusters.  Those same clusters are backed be multi-gigabit optical networks with redundant cooling solutions that are nothing short of world class.

HostForLIFEASP.NET Customer Support

The support program from HostForLIFEASP.NET is excellent. It truly keeps up to its promise of 24/7 support. Regardless the time of the day, customer support is always on and ready to be of service. The response can be described as fast, and, more importantly, helpful.

They also have a single page listing their “Most Frequently Asked Questions.” This page covers a variety of topics answering the most commonly questions asked.

Conclusion About HostForLIFEASP.NET ASP.NET Hosting

This is a good alternative if you need ASP.NET hosting. This hosting provider has support ASP.NET Core RC 2 on their hosting environment. They are good, affordable, and also reliable.

HostForLIFEASP.NET is good about maintaining uptime as they promised. While there may be a time here or there where maintenance is being performed, and therefore your website will go down, it is the exception, not the rule. With only 28 occurrences over a 9 year period, their reputation for reliability speaks for itself.

If you are a newbie or a small business, their windows shared hosting platform might be right for you.

[crp]