Forum Discussion
levyas
May 20, 2021Brass Contributor
MSIX: How to achieve automatic install of .net 5 required for my application?
Hi! I wrote a WPF program using .NET 5, packed it into the MSIX bundle (Release, x86 and x64) as a framework-dependent package. Everything seems fine, but there is one very annoying thing: on the ...
- May 24, 2021Hello, if it's an application based on .NET Core / .NET 5 (as I seem to understand from the description), the suggested and best way to distribuite via MSIX is to use the self-deployment approach. Thanks to MSIX features like differential updates and single disk instance, you don't have to worry too much about the increased size, since the runtime will be downloaded only at the first install.
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
Matteo Pagani
Microsoft
May 24, 2021Hello, if it's an application based on .NET Core / .NET 5 (as I seem to understand from the description), the suggested and best way to distribuite via MSIX is to use the self-deployment approach. Thanks to MSIX features like differential updates and single disk instance, you don't have to worry too much about the increased size, since the runtime will be downloaded only at the first install.
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
Otherwise, if you don't like self-deployment, you will need to use a script to pre-install the runtime. You can leverage some of the available script we release for CI/CD purposes here: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
I hope it helps!
Telemak68
Jun 09, 2021Copper Contributor
Hi Matteo,
Two weeks ago I asked you to explain how to add .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file or to to pre-install the runtime using a script Thanks in advance for your suggestions and recommendations.
Two weeks ago I asked you to explain how to add .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file or to to pre-install the runtime using a script Thanks in advance for your suggestions and recommendations.
- Matteo PaganiJun 09, 2021
Microsoft
Telemak68 I apologize, I missed the notification about your question. In a .NET 5 scenario, the best to achieve what you're trying to do is to use the self-contained deployment model (https://docs.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained), where the full runtime and all its dependencies will be included inside the package.
Scripts can be executed at the first launch using the Package Support Framework (https://docs.microsoft.com/en-us/windows/msix/psf/run-scripts-with-package-support-framework), but they still run inside the container, so it's not a good way to install dependencies which must be system-wide.
I hope it helps!
- Telemak68Jun 09, 2021Copper ContributorHi Matteo,
Thanks for your considerations.
The self-contained deployment model seems to have significant security related issues and may require regular patches from ISVs. This is what Microsoft Tech Support experts mentioned in their reply to my inquiry about deploying ..NET and Asp.NET components. They said that the global distribution of these prerequisites is the most reliable option that has a number of advantages, If you wish, I can share with you our email exchange.
This is why I would like to concretize how to deploy the redistributable packages, such as .NET, Asp..NET or .NET SDK. Running a script using PSF seems to be quite problematic because deployment of these prerequisites will require elevation. Is it possible to add the .NET 5 and ASP..Net references as Dependency packages to the AppXManifest file?
Thanks for your suggestions!- Matteo PaganiJun 09, 2021
Microsoft
No, unfortunately that's not possible. The Dependencies section of the manifest supports only a very specific subset of packages created by the Windows team, like VC++ libraries or the Project Reunion framework. .NET and ASP.NET aren't supported dependencies. I'm afraid that, if you want to go with MSIX, your best option is to use self-contained. I don't fully agree that the self-contained model has significant security issues but, for sure, it requires the ISV to own the patching and updating of the runtime (which might make things complicated in big enteprise environment, where a new version of the app must be deployed to all the devices in the company).