Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When <AppId> is child of <Package>: System.ArgumentNullException during build #7738

Closed
dbengle opened this issue Sep 20, 2023 · 2 comments · Fixed by wixtoolset/wix#464
Closed
Assignees
Labels
Milestone

Comments

@dbengle
Copy link

dbengle commented Sep 20, 2023

Bugs

If this issue is a bug:

  • Which version of WiX are you building with?
    WiX 4.0.2

  • Which version of Visual Studio are you building with (if any)?
    Visual Studio 2022 17.7.4

  • Which version of the WiX Toolset Visual Studio Extension are you building with (if any)?
    HeatWave for VS2022

  • Which version of .NET are you building with?
    4.8

  • If the problem occurs when installing your packages built with WiX, what is the version of Windows the package is running on?
    n/a

  • Describe the problem and the steps to reproduce it.

Add an <AppId> element like this as a direct child of the <Package> element:

 <AppId Id="{1edc7500-0c88-11d3-afe6-0000836054d2}" />

When you try to build the package, it will fail with the following error:
wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.

If you remove the <AppId> element, the problem goes away.
This worked in WiX 3.14.

  • Describe the behavior you expected and how it differed from the actual behavior.

When you try to build the package, it will fail with the following error:

 wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.

If you remove the <AppId> element, the problem goes away.

This worked in WiX 3.14.

@dbengle dbengle added the triage label Sep 20, 2023
@dbengle
Copy link
Author

dbengle commented Sep 21, 2023

The call stack looks like this:

wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null. [C:\Projects\ZDD\SetupZDD\Package\Package.wixproj]
Parameter name: componentId (TaskId:53)
at WixToolset.Core.ExtensibilityServices.ParseHelper.CreateRegistrySymbol(IntermediateSection section, SourceLineNumber sourceLineNumbers, RegistryRootType root, String key, String name, String value, String componentId, RegistryValueType valueType, RegistryValueActionType valueAction) in D:\a\wix\wix\src\wix\WixToolset.Core\ExtensibilityServices\ParseHelper.cs:line 172 (TaskId:53)
at WixToolset.Core.CompilerCore.CreateRegistryStringSymbol(SourceLineNumber sourceLineNumbers, RegistryRootType root, String key, String name, String value, String componentId) in D:\a\wix\wix\src\wix\WixToolset.Core\CompilerCore.cs:line 306 (TaskId:53)
at WixToolset.Core.Compiler.ParseAppIdElement(XElement node, String componentId, YesNoType advertise, String fileServer, String typeLibId, String typeLibVersion) in D:\a\wix\wix\src\wix\WixToolset.Core\Compiler.cs:line 571 (TaskId:53)
at WixToolset.Core.Compiler.ParsePackageElement(XElement node) in D:\a\wix\wix\src\wix\WixToolset.Core\Compiler_Package.cs:line 239 (TaskId:53)
at WixToolset.Core.Compiler.ParseWixElement(XElement node) in D:\a\wix\wix\src\wix\WixToolset.Core\Compiler.cs:line 221 (TaskId:53)
at WixToolset.Core.Compiler.Compile(ICompileContext context) in D:\a\wix\wix\src\wix\WixToolset.Core\Compiler.cs:line 129 (TaskId:53)
at WixToolset.Core.CommandLine.BuildCommand.CompilePhase(IDictionary2 preprocessorVariables, IEnumerable1 sourceFiles, IReadOnlyCollection`1 includeSearchPaths, CancellationToken cancellationToken) in D:\a\wix\wix\src\wix\WixToolset.Core\CommandLine\BuildCommand.cs:line 188 (TaskId:53)
at WixToolset.Core.CommandLine.BuildCommand.ExecuteAsync(CancellationToken cancellationToken) in D:\a\wix\wix\src\wix\WixToolset.Core\CommandLine\BuildCommand.cs:line 159 (TaskId:53)
at WixToolset.Tools.Program.Run(IServiceProvider serviceProvider, IMessageListener listener, String[] args, CancellationToken cancellationToken) in D:\a\wix\wix\src\wix\wix\Program.cs:line 103 (TaskId:53)
at WixToolset.Tools.Program.

d__0.MoveNext() (TaskId:53)
The command exited with code -2147467261. (TaskId:53)
Output Property: _WixBuildExitCode=-2147467261 (TaskId:53)
Done executing task "WixBuild" -- FAILED. (TaskId:53)

@dbengle
Copy link
Author

dbengle commented Sep 22, 2023

The System.ArgumentNullException is because the parent component ID is null. Since the parent is a package, there is no parent component. However, this did work in v3.14, and the schema documentation states that the parent of can be a .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants