Forum Discussion
MSIX: How to achieve automatic install of .net 5 required for my application?
- 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!
levyas I haven't replied as I don't know the package name you'd need. But ultimately, the AppXManifest file should have it listed as a Dependency package. By listing it in as a dependency there, the system will install the dependency for you from the Windows Store.
The form will be something like this example for the .Net.Native framefwork: "Microsoft.Net.Native.Framework.2.2.2.2.29512.0_x64__8wekyb3dbabbwe"
I would guess you might need both framework and runtime referenced. I'm not using any .NET 5 yet, so I'm not sure. Possibly you can run the PowerShell command
get-appxpackage -PackageTypeFilter Framework
On a system where the sdks are installed and they might show up. You'd want value from the PackageFullName in your appxmanifest dependencies.
If you find the answer, please post back and share!
- levyasMay 24, 2021Brass ContributorThank you for the reply! You gave me the way to browse the catalog of available dependencies; that's very helpful! I read about the command, run on my machine, looks like it contains only frameworks used by UWP hence there are no familiar to me names or versions (like .net 4.7, or .net core or .net 5). At least now I know that it is not what I'm looking for, so thank you again.
Maybe someday regular .net runtimes will be there too, that'd be nice.