How to deploy ASP.NET Core with COM module dependencies on Azure

wuibb 20 Reputation points
2024-03-22T23:12:21.7233333+00:00

Hello! 

We are trying to deploy an ASP.NET Core, .NET 8.0. Web Service to Azure. However, we have trouble registering the COM modules for the deployment process.

What we’ve tried:

  • Initially, we tried to deploy the service by publishing it to Azure as an App Service through Visual Code. (Reference: https://learn.microsoft.com/en-us/azure/app-service/quickstart-dotnetcore) However, we didn't find a way to register the COM modules. So they are missing when running the deployed app, leading to an error. 
  • Next, we tried to build the service in a Docker container. However, it appears we cannot use Docker with a .NET Core project that has COM references. (We get this error: The task "ResolveComReference" is not supported on the .NET Core version of MSBuild. Please use the .NET Framework version of MSBuild.)

We asked and researched around and found the following other options:

  • “Switch from .NET Core to .NET Framework to allow referencing COM modules”
  • “Deploy ASP.NET Core to IIS on Windows servers”
  • “Use Registration-Free COM Interop” 

However, we are missing a lot of context around these alternatives and are not sure where to go next. Frankly, we are a team that has not worked within this ecosystem and we are a bit lost. Any help would be much appreciated.

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
389 questions
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,377 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,167 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,881 questions
{count} votes

Accepted answer
  1. Lex Li (Microsoft) 4,742 Reputation points Microsoft Employee
    2024-03-23T19:13:33.78+00:00

    You can get started with a Windows Server virtual machine on Azure, which is the closest to what you previously used to develop/host such COM based bits.

    However, whether you can migrate to more modern options, such as Windows containers, is subject to the COM bits themselves (and their vendors if you still have contacts). I won't suggest you try that out all by yourself, as very likely you will hit different kinds of migration issues.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,031 Reputation points
    2024-03-23T16:11:31.6366667+00:00

    You should be using a windows container. Your com objects should already have an installer which you should run on the container build. If you don’t have one, you could use a .net 4.8 project for the com objects install and create an installer that you run before the .net install.

    0 comments No comments