Microsoft just released the RTM version of ASP.NET Core 3, the new multi-platform framework that allows to develop and host code on both Windows and Linux. ASP.NET Core applications can be seamlessly hosted on our hosting packages and it doesn’t require special configuration or dedicated machines.
How to use ASP.NET core with our cloud hosting services
Our cloud hosting service is ideal to host applications that could require an high degree of scalability thanks to its shared and dedicated instances. You can start with a single shared instance and then scale up to multiple instances to improve application performances. To publish your ASP.NET Core application on a cloud hosting account you need to generate a framework-independent build of it. Such environments don’t provide default ASP.NET Core runtimes so that users can customize them the way the need.
Publishing to our cloud hosting service supports both Tiered Compilation (TC) and Ready-to-Run (R2R) images: both of them allow to improve application startup times.
When you’re ready to publish your application, follow these instructions:
- edit the main .csproj file to enable Tiered Compilation (TC) and Ready-to-Run (R2R) images:
<PropertyGroup> <TargetFramework>netcoreapp3.0</TargetFramework> <TieredCompilationQuickJit>true</TieredCompilationQuickJit> <PublishReadyToRun>true</PublishReadyToRun> </PropertyGroup>
- prepare your application after enabling a framework-independent build for the “win-x64” architecture.
After building your application, target folder will host all those files that you need to move into the “wwwroot” folder of your website. Please note that inside the target folder is located an additional “wwwroot” folder according to the default setup. Such folders share the same name but the “wwwroot” folder inside the target path must be published inside the “wwwroot” folder that represents the root of the website.
Before you publish your application you need to edit the web.config file inside the target folder and make some changes. Locate the following rows:
<location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" /> </handlers> <aspNetCore processPath=".\NETDemo.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" /> </system.webServer> </location>
and change the following row
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
then change the following row
<aspNetCore processPath=".\NETDemo.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
<aspNetCore processPath=".\NETDemo.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
Now you can publish your files to the root of the hosting account. By using this configuration you will achieve the maximum available performance.
How to use ASP.NET Core 3 with VSW Linux .NET accounts
VSW Linux .NET service has been designed for customers that need to quickly publish their applications or websites that won’t probably need a high degree of scalability. To make publishing easier, these services support framework-dependent applications so you will only need to publish a reduced set of files. However, you will not be able to customize your runtime.
To prepare your application just setup building using framework-dependent configuration and set the target runtime as “Portable”. No other changes are needed. You will need to publish your files into the “public_aspnet” folder, not the “public_html”.
VSW Linux .NET accounts support .NET Core 2.1, 2.2 and the new 3.0.
ASP.NET Core 3 support is available on both Windows and Linux. Services are designed with different type of applications in mind and different scalability needs.0