Publishing ASP.NET Core 3.0 application as self-contained executable to Azure App Service
With Visual Studio 2019 we can publish ASP.NET Core 3.0 applications as self-contained executable. It’s specially useful for environments where ASP.NET Core 3.0 is not installed or where we don’t have permissions to install it. Here’s how to do it.
Here's how to run ASP.NET Core 3.0 applications on Azure App Services where .NET Core 3.0 is not available. Click To Tweet
All the magic happens when we create publishing profile for ASP.NET Core 3.0 application in Visual Studio and click Advanced… link.
If you have existing publishing profile then just open it and click on edit icon after Target framework.
Notice two options in this dialog:
- Deployment mode. It is either Framework-Dependent (target framework must be available on App Service) or Self-Contained (no need to install target framework before deployment).
- Target runtime. This must match the platform and hardware architecture of target machine. I went with win-x86.
Select target runtime, save profile and publish your application. If everything went okay then very soon new browser instance opens with your ASP.NET Core 3.0 application running on Azure App Service.