The great thing about ASP.NET Core is that it’s portable, allowing you to run your Core application on any OWIN-compatible server. So, even if a particular version of .NET Core is not installed on the server, you can still deploy your Core app in “self-contained” mode.
In this example, we’re going to use the Orchard Core application. Orchard Core is a re-write of the original Orchard application (the thing that runs all the MSDN blogs) in ASP.NET Core. As of the time of this writing, Orchard Core is using ASP.NET Core 2.0. And, at the time of this writing, we have not yet updated our servers with the newest .NET Core to support ASP.NET Core 2.0 natively, but, to repeat: you can still deploy your Core app in “self-contained” mode.
First, some house-keeping. Make sure you have the .NET Core 2.0 SDK installed and Visual Studio is updated.
Orchard Core supports different databases, SQL, SQLite, MySQL and Postgres. I’m going to use SQL, which is included with all Winhost plans. This is a good time to create the SQL database in your Winhost control panel.
Onto the instructions:
By default, Orchard Core is Framework-dependent. We have to change that to make it self-contained. We have to specify the target platform (tell the application what kind of server it’s going to be running on). In my case, my Winhost site is running on Windows 2012/IIS 8. You can find this information in your Winhost control panel, under the Site Info section. The Runtime Identifier for Windows 2012/IIS 8 is: win8-x64. If you’re site is running on a different server, you can check out the full catalog of Runtime Identifiers here.
<RuntimeIdentifier>win8-x64</RuntimeIdentifier>
Now we’re just about ready to publish. This would be a good time to remove the parts of Orchard Core that you’re not going to use. (For this example site, I didn’t remove anything.)
Before, pre-2.0, we would have run the dotnet restore and dotnet build commands at this point. But now, those are implicit commands with publish. So you can just run the publish command (right-click OrchardCore.Cms.Web and select “Publish…”). I used FTP to publish the project directly onto the Winhost servers. Instructions for different deployment methods are available here.
Wait for the project to publish, then navigate to your site and you should see the Orchard Core setup page:
I picked the Agency Recipe. Fill out all the fields, click the Finish Setup button and you should see your new site:
Hi
I am not able to run orchard core from IIS.
I am getting orchard setting page. But when i enter settings and click on “Finish Setup”, I am getting error “Server refused to connect”.
Please guide me
Thanks
I found solution. wwwroot folder was missing when I published application. I added folder manually in publish folder. That’s it.
Awesome. Glad you got it to work.
Is ASP.NET Core 3.1 supported for deployment?