Search code examples
.net-corewixsharp

How can we bundle and install lower version of dotnet core using Wix Sharp?


We developed our application and tested over DotNet core 3.1.101 and it was working fine but what happened is Microsoft updated dotnet core to 3.1.111 and it breaks our application and we are asking customer to downgrade the core version manually that doesn't seem to be good idea.

Can somebody Wixsharp/.Net expert suggest, how can we avoid this problem? Can we have side by side installation of dotnet core and use the desired on with our application? If yes, How can we do it?


Solution

  • If you are really dependent of the specific net core version, the best solution to you will be to use self-containing publishing (https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained). This will create the solid bundle from your code and the your current net core version. On the client machine your app will use the net core, which is bundled with app. User may have other versions of net framework/net core installed, but these versions will not affect your app in any way.

    For example, the following will create 64-bit executable for Windows dotnet publish -r win-x64.

    After you got your bundle from publish command, you need just pack the whole bundle with wix as usual. Not need to perform additional steps to install net core.