fix: BuildTasks assembly reference resolution and add DsComExportTypeLibraryDependsOn hook - #442
Conversation
In order to find the correct assemblies from the references, the references must be filled. The assemblies hence should be consumed via ReferencePath item group. This also introduces a new pre-export dependency. In order to do this, a new DependsOn Property is introduced.
The DsComAsmPath MetaData is introduced from the directory of the reference. CAVEAT: dscom tlbexport --asmpath has a bug: The directory is marked as not found, if it ends with a trailing backslash
Include only the directories from the references. Only include the directories, skip all other metadata. This will make all items unique in the list.
If TLB Export succeeds (file is created), ignore the exit code and issue this as a warning.
Add documentation for dependency group DsComExportTypeLibraryDependsOn
|
Thanks, Carsten. The reported problem appears to be fixed: the NuGet dependency is resolved correctly and the affected type is included in the generated type library. However, could changing IgnoreExitCode from false to true be an unintended side effect? A failing dscom invocation can now result in a successful MSBuild exit code. This change does not seem necessary for fixing #440. I suggest keeping IgnoreExitCode="false" and limiting this PR to collecting the resolved NuGet references after ResolveReferences. If special exit-code handling is required, it should be addressed separately with the intended failure semantics clearly defined. @matthiasnissen, could you please confirm this assessment? |
|
Agree with @marklechtermann's assessment. The reference-resolution fix (ResolveReferences/ReferencePath, --asmpath normalization) is clean and correctly scoped to #440. However, IgnoreExitCode=true is an unrelated, potentially breaking behavior change: a failing dscom invocation would no longer fail the build (only emits a DSCOM005 warning). CI pipelines relying on the exit code wouldn't catch that anymore. Suggestion: split this out into a separate PR/discussion (maybe as an opt-in property) so the actual bugfix can be merged independently. |
This reverts commit 866e5e6. After Code review comments by @marklechtermann and @matthiasnissen in PR #442
|
@marklechtermann @matthiasnissen I agree with your opinion on the ExitCode. But dscom always created the TLB file, even error state. |
Fixes bug #440 by improving build task dependency handling, reference discovery, and export result reporting.