1

I have an existing custom action project in .Net framework 4.8 and wix setup project v3. The goal is that I need to convert the framework project to SDK. I found out that WIX v3 doesn't support SDK projects and needs to move to WIX V4.

I tried below steps to convert-

  1. To convert.Net framework to SDK I run the below commands and it converted successfully.

    dotnet tool install --global Project2015To2017.Migrate2019.Tool
    dotnet migrate-2019 wizard <.csproj filepath>
    
  2. To upgrade WIX v4, I run the below commands.

    dotnet tool install --global wix --version 4.0.0-preview.0
    wix convert Product.wxs
    wix build Product.wxs -o Product.msi
    

initially, I got a few errors for namespace and target directory but managed to resolve this.

Now the problem is SDK project doesn't generate .CA.dll file so how to generate this file to map in the .wxs for custom action to work?

Also if there is any better way to upgrade wix v4 , please suggest?

James Z
  • 12,209
  • 10
  • 24
  • 44

1 Answers1

1

To create a managed custom action in v4, create a regular SDK-style .csproj and then add a PackageReference to WixToolset.Dtf.CustomAction.

MSBuild and managed custom action support was not available in preview.0. The recommended way to upgrade the projects is probably going to be to create the v4 project from scratch.

The sample ManagedCA is currently at https://github.com/wixtoolset/wix4/blob/8e1cbe8d7b468553d76c20452561e89726de5c47/src/test/burn/TestData/WixIuiBaTests/ManagedCA/ManagedCA.csproj. The build for the v4 repo is currently pushing the .nupkg to the Github repo so you could try them out by adding its Github Packages Nuget feed - https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-nuget-registry.

Sean Hall
  • 7,629
  • 2
  • 29
  • 44