ASP.NET Hosting Tutorial – How To Make ASP.NET 5 Works on IIS

Best Cheap ASP.NET Hosting | ASP.NET 5 which has renamed to ASP.NET Core 1.0 has been an outstanding framework for web development, more and more people are looking at production deployments and other real life use cases of it. If you’re thinking about hosting it on Windows environment, most likely means IIS, we have documented and highlighted some of the steps, which hopefully will save a bit of your time. Yes, in this article, we will tell you how to make ASP.NET 5 works on IIS.

How To Make ASP.NET 5 Works on IIS

How To Make ASP.NET 5 Works on IIS

Step 1 – Adjust Your Application

In order to be able to run on IIS, your application needs to include Microsoft.AspNet.IISPlatformHandler package. There is currently an 1.0.0-rc1-final version available which should be added as a dependency to your project.json. You should then add the platform handler middleware to the Configure method in your Startup class:

If you are using the latest (RC1) ASP.NET 5 templates, then the ASP.NET 5 Web Application template already references the Microsoft.AspNet.IISPlatformHandler package and even has the above line of code in the Startup class by default.

Step 2 – Publish Your Application

First of all you need to publish your application. If you are really old school, you may want to do it from Visual Studio and its classic “Publish” dialog, but it will not do anything magical – all it will do is just call into the command line dnu tool. So instead, you can call it yourself from the folder of your web application (you can also pass the path to the web application project if you wanna invoke dnu from anywhere) and save yourself a hassle of even opening Visual Studio (or maybe you are on a Unix and you don’t even have it).

This command will publish your project and include the currently active runtime. You can obviously include a specific runtime too if that’s your intention, by passign its name. The publish command has plenty of other options such as for example specifying the source inclusion or the out path.

DNU Publish Help

Usage:

Arguments:
Options:

o|out <PATH> Where does it go
configuration <CONFIGURATION>The configuration to use for deployment (Debug|Release|{Custom})
nosource Compiles the source files into NuGet packages
framework  Name of the frameworks to include.
 iiscommand Overrides the command name to use in the web.config for the httpPlatformHandler. The default is web.
runtime <RUNTIME>  Name or full path of the runtime folder to include, or “active” for current runtime on PATH
 nativeBuild and include native images. User must provide targeted CoreCLR runtime versions along with this option.
includesymbolsInclude symbols in output bundle
wwwroot <NAME>   Name of public folder in the project directory
wwwrootout <NAME>Name of public folder in the output, can be used only when the ‘–wwwroot’ option or ‘webroot’ in project.json is specified
quiet  Do not show output such as source/destination of published files
?|h|helpShow help information

By default, the output path is bin/output in the same folder as your web application. The output can be xcopied to the server just like that. The published source should have the following structure:

How To Make ASP.NET 5 Works on IIS 1

Inside the approot folder there will be a web.cmd file which can be used to start your app. You can also start it by simply getting into wwwroot and calling dnx web. Of course IIS knows nothing about all this, so you’ll need some extra IIS setup to make it understand the external DNX process.

Step 3 – Setting Up IIS

The prerequisite in IIS is that the HttpPlatformHandler module needs to be installed (minimum version 1.2). This component is nothing ASP.NET 5 specific – it simply allows process management for external processes that listen for HTTP requests and proxies requests into it; in this case it will be dnx.exe but it might as well be something like node.exe. You can install the latest handler using direct installer or WebPI from IIS download site here.

Once you have published your ASP.NET 5 app (previous step), you can proceed to setting up IIS.

1. Create a new application, and set the .NET CLR version on application pool to No managed code. We’ll be calling into dnx.exe to start your application, rather relying on the classic w3wp process.

2. Point your website to the wwwroot folder inside your publish output (previous step) location – or wherever you copied it to. If you run the application pool using the application pool identity, you have to make sure that IIS_IUSRS has access to your publish folder.

If you navigate to your site now and everything just works, then great. You can stop reading this post as your job is done, but at this point, chances are things will not be working yet. That wwwroot has a web.config file inside which should at this point look like this:

You may want to set that stdoutLogEnabled=“false” to true immediately cause you’d want to get the errors, normally written to stdout of a hidden process, to be redirected to the log file.

Step 4 – Resolving Issues

One possibility is that you see the following HTTP Error 500.19:

How To Make ASP.NET 5 Works on IIS 2

This is because at the global config level, the system.webServer/handlers section is locked. To unlock it, go to IIS Manager, select your server root in the left navigation tree, then choose “Configuration Editor” > type system.webServer/handlers in the section selection dropdown and press enter. Then choose “unlock section” from the right action pane.

How To Make ASP.NET 5 Works on IIS 3

Another (or next) potential issue that you may encounter, is that you see a blank page, that appears to be stuck loading forever. If that’s the case check the logs folder under the path defined in the web.config. Most likely possibility is that dnx command is not being recognized. The reason for this is that the user used to run the IIS process doesn’t have it in the PATH. To combat this, you can do a few things:

1. Change the application pool user to a one that has DNX on the PATH (i.e. your own user account)

2. Add the DNX environment variables as a system-wide variables:

  • DNX_HOME, should point to your DNX folder, for me it’s C:\Users\filip\.dnx
  • DNX_PACKAGES, should point to your DNX packages folder, for me it’s C:\Users\filip\.dnx\packages
  • DNX_PATH, should point to your DNVM cmd file, for me it’s C:\Users\filip\.dnx\bin\dnvm.cmd

If you choose this approach, you have to make sure that IIS_IUSRS has access to all the above folders too. Note that on IIS 10 you can also set environment variables specifically for the application pool.

3. Instead of using …\approot\web.cmd to start up your application, you can also hardcode a path to dnx in the processPath attribute of the httpPlatform inside web.config. If you do that, you also need to pass the web argument in the arguments attribute.

Finally, there might some other issues not mentioned here, that you can identify through the log file. For example, perhaps you provided a custom path to the dnx.exe but have not provided the arguments (“web”). This type of error would simply show up in the log as the usage help for dnx.

Step 5 – Running ASP.NET 5 on IIS 7.5, IIS 8 and IIS 10

Overall, we tried this process on IIS 7.5, IIS 8 and IIS 10 and at the end it ran successfully everywhere!

How To Make ASP.NET 5 Works on IIS 4

Best Cheap ASP.NET 5 Hosting Recommendation

While there are many programming languages out there for a web developer to choose from, one of the most successful programming language till this date is ASP.NET. It has matured over the years with the latest version, ASP.NET 5, having a number of new features and enhancements. You may already have heard that ASP.NET 5 hosting is offered by several web hosting providers. However, choosing the best cheap ASP.NET 5 hosting isn’t an easy task. In this article, we have listed the top 3 best cheap ASP.NET 5 hosting providers according to our hosting review experience.

Looking For E-Commerce Hosting? Consider These Things First!

Best Cheap ASP.NET Hosting | If you are a retailer and don’t have an online shop yet, you should consider building one as quick as possible. There are many things to consider when developing an online shop, but there are two very important aspects of a successful e-commerce site: shopping cart platform and web hosting. In this article, we will present you the features you should consider when purchasing e-commerce hosting for your website.

Consider These E-Commerce Hosting Features

High-Performance

A high-performance server with proper resources can really help you boost and maintain your e-commerce website not having any technical difficulties and maintaining your customers happy and very polite. If the web host provides you with a powerful CPU, a well maintained operating system, enough space storage, RAM, bandwidth and also with an SSD instead an HDD to improve speed, even more, you already are on the right way to maximize your revenue. It is also a good idea to have unlimited add-on domains, email accounts, databases, sub domains in case you need them to create other secondary projects around your website.

Uptime

99.99% uptime is usually guaranteed through a contract, but you need to know for real that your web host uptime is at least 99% and it should have real time statistics regarding their uptime and their server performance. There are different software that can tell you the uptime of a remote or local server depending on the operating system used such as Uptime.exe for Windows servers. Some of this software are online such as Uptime Robot that send you emails each time your website/ host is down or up again. The software has a powerful dashboard and sends alerts through e-mails, SMS and Twitter, monitoring https, ping, port and keywords and also viewing the uptime, downtime and the response times. It is very frustrating for customers to enter or browse the website but it is unavailable because of the downtime.

Daily Backup

Daily backup with the help of a professional software such as R1Soft or using a simple automatically install script like Softaculous or Fantastico if you use a predefined CMS like WordPress can be created in order to save your website with its text, images, videos, design, databases and other sensitive information like customer accounts and added products. Don’t forget to make a full backup, both the databases and all the FTP content must be saved daily if you have a lot of changes on your website, else you can try making a weekly or a monthly backup for rare changes, but even so there is a possibility for technical issues or hacking problems so you should remain at daily backups.

Contorl Over Resources

Total control over resources is the best way to manage and maintain your website’s speed and performance. To do this you actually need at least a VPS or a dedicated server, it maybe a little expensive at the beginning for you but sure it’s worth its value, nobody else using resources from the same server you use and you have full control over them using control panel and other online software that are able to optimize at maximum the resources you have available.

SSL Certificate

An SSL Certificate increases the security and safety of your customers by marking the website safe with a green seal at the link of the website. Practically, an SSL Certificate contains data files of the website that is sent to the browser every time somebody accesses your e-commerce website by activating the https protocol over port 443 and allowing secure connections between the web server that host the website and the customer’s browser so credit card transactions, logins, and other delicate data can be safely. An SSL Certificate binds together the domain name, server name or the hostname with the company name and its location so this information are usually showed near the green seal.

Dedicated IP

A Dedicated IP is needed for a safe e-commerce website because it gives the website a unique internet address dedicated exclusively to it and it lets you use an SSL Certificate, view the website through its IP address, access the FTP accounts when the domain is unavailable and ensures fast response during high traffic load. A dedicated IP also provides higher stability, access, business identity and it is required by third-party applications and helps you in problems with old browsers incompatibility. With a dedicated IP, you will no longer have problems with sending emails being banned or blacklisted because someone on the shared IP spammed or made another crazy thing.

Technical Support

24/7 technical support should be available on phone, on email both visible on the web host’s website, live chat and ticket system created especially for their clients in case of any technical problems or additional requirements and information needed by you. The support team should be very polite, quick in their answers, precise and clear so you can understand their replies very easy and you can manage the appeared problem or the new information without a headache. Financial problems such as invoices should be resolved by the financial department and not the technical one.

Security

Enhanced security can be a real problem if your web host doesn’t offer you the best one! In this case is the possibility that not only hackers can access your website’s passwords and other sensitive data, but also usual users of your website can see private information if the security isn’t improved, updated and enhanced by multiple software installed on the web host’s server. Security is the key of credit cards and other online transactions through a website.

In addition to a great web host and shopping cart system, you also need a great web design, good SEO and high quality product images. Depending on the amount of products you are going to have in your online shop, here are some recommendations of great e-commerce hosting providers:

You didn't add any pricing tables yet!

Plan To Build A Website For Business? Check Out These Tips!

Best Cheap ASP.NET Hosting | Using email for business and having a website is only the start on the long road of establishing your online business. It is certainly not enough to have a professional email account, an average looking website and a good domain name that can easily be branded. You should understand that creating an online business is as hard as establishing your business offline. For a successful online business you should create a great foundation that will be your website. To help you out, we have created the list of tips including the most important aspects you should pay attention when you’re planning to build a website for business.

Business young couple with laptop in hotel Lobby

Tips To Build A Website For Business

#1. Make Your Website Responsive

It is incredible how fast technology and user’s habits are changing. Few years ago the “responsive web design” was almost an unknown term in the online development world, buy today this is a must need for every website. Creating a responsive web site means, that your site will use latest HTML5 and CSS3 technologies, which will make it responsive: its layout will change, depending on the screen resolution of the device it is accessed from. While the content will remain the same, the website will render differently to a desktop and a smart phone user. In April 2015, Google added the responsive feature into their search algorithm, so websites that has a mobile friendly layout, will most likely gain some benefits in the search results over those websites which are not responsive. In the US around 60% of adults own a smart phone, and around 50% own a tablet. This means, that missing the responsive feature, your site will be listed below your competition and if mobile users will find your website difficulty to navigate from a smart phone or a table they will leave and you will be loosing clients. Here are several tips to make a responsive web design.

#2. Make Your Site User Friendly

It is not enough to have a well optimized site for search engines. Users are the most important, because they are your potential customers. When designing your website, think with the eyes of a user, who is searching for a product or service. Users are inpatient, so if they can’t find what they are looking for within 2-10 they will leave. Make sure that your site easy to navigate, the text is readable on every device, and your website loads fast and smoothly. Pop-ups can be very frustrating, so do not use this feature, only if necessary. Make your contact info or the buy now button as visible as possible to have a higher conversion, but still keep them within the color scheme of your design.

#3. Make Your Website Social Friendly

Social media can also be very useful to bring you more customers. It is not good idea to rely on one traffic source, for instance on organic search traffic. Build a strong online community around your site and keep a friendly communication with your followers. Add social sharing buttons to your site, making it easy for the users to share and distribute your content. Aggressive self-promotion on the social platforms can cause users to un-follow you; time-to-time post funny as well informative content to your accounts, keeping a friendly attitude. Social management is a hard task, and you have to pay attention to complains. If a customer complains in the public, try to solve the situation privately and do not let your other customers to find out about a certain problem you may have.

#4. Optimize Your Website For Search Engines

Making your site responsive is part of the optimization process; however search engine optimization is a more complex task, which will help your website get more organic traffic from search engines. Google is getting smarter, so the old tricks when spamming keywords all over your site helped in rankings, will not work anymore. In fact, these days high quality, relevant and informative content is what can bring you to the top. Certainly the H1, H2 tags are still important as well keyword research. By adding relevant images with alt tags and videos to your pages can give you extra benefits.

#5. Test Your Website

After a website is up and running, it can always have minor problems. Ask your friends, employees, family members to test your website. Maybe someone can point out a problem or can give you ideas on how to improve the layout and the navigation of the website. Always find new ways to improve your website and create a better user experience using the latest web design trends and technologies.

#6. Choose The Right Host For Your Website

The look of your website and the quality of the content plays an important role on the way to a successful online business, but keep in mind that web hosting also plays a big role. You can have a perfectly optimized website, with an interesting design and thousands of followers, if the hosting fails, your business fails. If you are looking for a reliable business hosting provider, we recommend you to HostForLIFE.eu, they provide unlimited domain, unlimited bandwidth also unlimited disk space for your website’s needs. With 99.9% uptime, they promise that your website will run smoothly in their server. Or if you want to check more about the hosting industry, just check out our web hosting review page.