@joebigelow / wix-1 / commits / 00a024e8

Pack CA assembly only after it exists

Trying to pack the CA assembly before it is built reports erroneous or redundant error messages so don't do that. Fixes 6968

Rob Mensching committed Oct 25, 2022 at 11:29 UTC 00a024e8595784e485115543f6045a0c5ea11ebc
1 file changed +6 -2
src/dtf/WixToolset.Dtf.CustomAction/WixToolset.Dtf.CustomAction.targets
+6 -2
@@ -23,7 +23,10 @@
23 PackCustomAction
24
25 Creates an MSI managed custom action package that includes the custom action assembly,
26 - local assembly dependencies, and project content files.
26 + local assembly dependencies, and project content files. This target is skipped until the
27 + custom action assembly has been built. This prevents the target from running (and failing)
28 + during project restore and other scenarios where the project is executed but the assembly
29 + build is skipped.
30
31 [IN]
32 @(IntermediateAssembly) - Managed custom action assembly.
@@ -36,7 +39,8 @@
39 -->
40 <Target Name="PackCustomAction"
41 Inputs="@(IntermediateAssembly);@(Content);$(CustomActionContents)"
39 - Outputs="$(IntermediateOutputPath)$(TargetCAFileName)">
42 + Outputs="$(IntermediateOutputPath)$(TargetCAFileName)"
43 + Condition=" Exists('@(IntermediateAssembly)') ">
44
45 <!-- Find all referenced items marked CopyLocal, but exclude non-binary files. -->
46 <ItemGroup>