The process for publishing and deploying a Cofoundry website is the same as deploying regular asp.net core website. There are however some things to consider:
View pre-compilation
View pre-compilation is enabled by default in asp.net core which prevents the raw view files being published. This is a problem because Cofoundry relies on these files to load in page and block templates.
To work around this issue you'll need to add two settings to your .csproj project file and set them both to false:
MvcRazorExcludeViewFilesFromPublish
: Setting this to false makes sure view files are deployed with your website.MvcRazorExcludeRefAssembliesFromPublish
: Setting this to false allows non-compiled views embedded in Cofoundry libraries and plugins to be loaded.
Example .csproj file:
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<MvcRazorExcludeViewFilesFromPublish>false</MvcRazorExcludeViewFilesFromPublish>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
</PropertyGroup>
<!-- other nodes removed for clarity -->
</Project>
This is an area we intended to work on to reduce friction, and it is also something the asp.net team are looking to improve. This is tracked in issue 137
Multi-instance & web farm deployment
Multi-instance deployment is not yet supported, mainly because we need to add a distributed cache implementation for IObjectCacheFactory
. This shouldn't be too difficult to do, it just isn't done yet! See issue #46.