Custom Action using WixToolset.Dtf.CustomAction fails build at MakeSfxCA when trying to target NET Standard 2.0 #8198
Unanswered
bevanweiss
asked this question in
Questions
Replies: 2 comments
-
DTF only supports .NET Framework, so that's probably expected. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm creating a new Custom Action for WiX v5, and when I create this with Heatwave inside Visual Studio 2022 it does indeed work fine.
However it creates the project as targeting .NET Framework 4.7.2. With the direction Microsoft are taking around .NET, I'd ideally like to have it be targeting .NET Standard 2.0 (so that it's still supported in the future under variants of .NET Core)
After creating a new Custom Action project, and then changing the .csproj TargetFramework from net472=>netstandard2.0, a build results in the following error:
This appears to be due to the ReferenceCopyLocalPaths MSBuild property no longer including any of the assembly references for dependencies, which is referenced within the CustomAction.targets file in the locations shown below:
https://github.com/wixtoolset/wix/blob/4946477e98000db6769facea5c1cab8f50386b94/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets#L47
https://github.com/wixtoolset/wix/blob/4946477e98000db6769facea5c1cab8f50386b94/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets#L55
When replacing these two "ReferenceCopyLocalPaths" with just "ReferencePath" then it appears that things get a tiny little bit further, but the subsequent error is:
Which, if I look into the .rsp file I can see:
If I remove the netstandard.dll reference, and then re-run the same MakeSfxCA.exe command, things all seem to build 'fine'
So... it appears to build (a DLL of ~8MB, the approx size as the .NET 4.7.2) if I make the following change on https://github.com/wixtoolset/wix/blob/4946477e98000db6769facea5c1cab8f50386b94/src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets#L47:
I suspect this isn't the right "fix"... but it might give some clues to someone that knows far more than me around how to get Custom Actions for netstandard+ targets.
Beta Was this translation helpful? Give feedback.
All reactions