Why you still can't create self-contained COM deployments with .Net #113345
-
Why you still can't create COM component in C# with self-contained deployment? here link to documentation that says it is not possible https://learn.microsoft.com/en-us/dotnet/core/native-interop/expose-components-to-com
So ppl using MSIX package to deploy their apps - which is supposed to be the future of windows installation, microsoft doesn't give an option to install a framework package for .Net. As a workaround they suggest to use self-contained deployments - there is no way around that - you basically forced to use dotnet self-contained deployment if you choose MSIX. If you do that you are not allowed to use COM components written in .NET because they are not supported by self-contained deployments. What is the reason for this limitation and is this going to be resolved ever? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This limitation is also very problematic for us. So unfortunately, we are at a point where we either drop such feature in general, only support it for customers that have the correct .NET runtime installed by their own or have an additional installer that installs the needed runtime(s) only for that feature in parallel to the still self-contained .NET apps we provide. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure why COM hosting with self-contained deployments is not supported, but I can imagine that it is to prevent loading multiple .NET runtimes in the same process. Distributing the .NET runtime in an MSIX package is tracked in #51574. Maybe you could use Native AOT to create a self-contained COM host, but I am not familiar with COM hosting and don't know if it will work or what the complications would be. |
Beta Was this translation helpful? Give feedback.
I'm not sure why COM hosting with self-contained deployments is not supported, but I can imagine that it is to prevent loading multiple .NET runtimes in the same process. Distributing the .NET runtime in an MSIX package is tracked in #51574.
Maybe you could use Native AOT to create a self-contained COM host, but I am not familiar with COM hosting and don't know if it will work or what the complications would be.