Knowledgebase
Hosting .Net Core Applications (also known as ASP.Net Core or ASP.Net 5.0)
Posted by Paul Woodland on 02 March 2017 08:50 PM

From March 2017, all LiquidSix Hosting hosting plans that support ASP.Net also support the new .Net Core from Microsoft. You can develop .Net Core applications using Visual Studio or other tools. This knowledgebase article covers the steps to host your new application with us once it has been developed.

Once you have developed the application, you can use Visual Studio (or an alternative) to publish it to a directory on your computer. This will contain directories such as "bin", "refs" and "wwwroot" (amongst others) and files including a "web.config" and "appsettings.json".

The web.config file should look something like this:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380
-->
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\WebApplication1.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>

You should not need to change anything in this file, however is may be useful to understand it's construction. The handlers section will tell the server to use ASP.Net core. The configuration below sets details about how the application will be run, however for security reasons, a lot of the fields are ignored on our shared hosting and the defaults will be used. The following settings are ignored:

  • processPath
  • startupTimeLimit
  • shutdownTimeLimit
  • requestTimeout
  • processesPerApplication
  • rapidFailsPerMinute

The most important setting is the "arguments" one, which specifies the DLL that contains your application. This one must exist in the file, and Visual Studio should have included it.

Another file you may need to look at is "appsettings.json". This includes the database connection strings if your application uses a database, and so you may need to edit these in order to point them at our database server instead of your own local development server. The connection string would be the same as for a non-.Net core application.

Once you have these files correct, you can upload the application to our server. Connect via FTP in the normal way, and upload all of the files (including all DLLs) from your application directory to the "wwwroot" folder in FTP. Although they have the same name, our "wwwroot" folder is different to the one in your application, and your one will end up inside the server one.

When the files are uploaded, the only thing left to do is to enable .Net core on your website. To do that, login to your hosting control panel with us and click on "Domains", then your domain, then click "Website Settings". Ensure that ASP.net is enabled, and then select ".Net Core" from the dropdown box for the ASP.Net version. Please note that when using .Net core on a domain, you can not use other ASP.Net files on the same domain.

That's it, your application should now be working! If you have any problems or suggestions with the new .Net core support, please contact us in the normal way.

(4 vote(s))
Helpful
Not helpful

Comments (0)