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

System.ArgumentNullException #7724

Open
jhjacobs opened this issue Sep 12, 2023 · 8 comments
Open

System.ArgumentNullException #7724

jhjacobs opened this issue Sep 12, 2023 · 8 comments
Assignees
Labels
Milestone

Comments

@jhjacobs
Copy link

jhjacobs commented Sep 12, 2023

Which version of WiX are you building with?
I created a project in Visual Studio 2019 called a Bundle (Wix v4) project. So the version is v4.

Which version of Visual Studio are you building with (if any)?
Microsoft Visual Studio Professional 2019
Version 16.11.20
VisualStudio.16.Release/16.11.20+32929.386
Microsoft .NET Framework
Version 4.8.09037

Installed Version: Professional

Wax Wax
WiX Setup Editor

WiX Toolset Visual Studio Extension 1.0.0.22
WiX Toolset Visual Studio Extension version 1.0.0.22
Copyright (c) .NET Foundation and contributors. All rights reserved.

Which version of .NET are you building with?
My solution consists of three projects. The three projects are a simple C# application, a wix3 msi builder, and the wix 4 bundle project. The C# project targets Dotnet Framework 4.8.1. The project properties of the two wix projects don't show a Dotnet framework target as far as I can tell.

I have attempted to build an installer which just bundles Dotnet Framework 4.81, and a simple test application.

I keep getting an error which says "wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.'
I was expecting to get an installation exe file that could be used to check for and install Dotnet Framework 4.8.1 if it isn't already installed, then install the msi package built with wix3.

See https://stackoverflow.com/questions/77091428/wix-installer-bundling-dotnet-framework-4-81-with-previously-built-msi

@robmen
Copy link
Member

robmen commented Sep 12, 2023

You have to be kidding me guys this text editor does not take XML.

Why are you complaining at us? It's the GitHub markdown editor. Either indent each line of your code with 4 spaces or use three ticks like:

 ```
<Code goes between those ticks/>
 ```

Learn more about how to put code in the editor via their documentation.

And why did you delete the bug template information? That helps us triage issues.

@jhjacobs
Copy link
Author

Sorry robmen, a bit frustrated my bad. I'll try again.

I have attempted to build an installer which just bundles Dotnet Framework 4.81, and a simple test application.

I keep getting an error which says "wix.exe : error WIX0001: System.ArgumentNullException: Value cannot be null.'

I created a Bundle (Wix v4) project below is the Bundle.wxs file.

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
  <Bundle Name="TestBundleInstaller" Manufacturer="TODO Manufacturer" Version="1.0.0.0" UpgradeCode="d090a306-15fc-4e04-985e-83cbb3a2cf5f">
    <BootstrapperApplication>
      <bal:WixStandardBootstrapperApplication LicenseUrl="https://www.example.com/license" Theme="hyperlinkLicense" />
    </BootstrapperApplication>

    <Chain>
        <!-- TODO: Define the list of chained packages. -->
        <ExePackage DetectCondition="WIX_IS_NETFRAMEWORK_48_OR_LATER_INSTALLED" InstallArguments="/q" UninstallArguments="/q">
            <Payload SourceFile="DirectoryTo\NDP481-x86-x64-AllOS-ENU.exe"/>
        </ExePackage>
        <!-- <MsiPackage SourceFile="path\to\your.msi" /> -->
        <MsiPackage SourceFile="DirectoryTo\TestSetup.msi" />
    </Chain>

  </Bundle>
</Wix>

Below is the TestBundleInstaller.wixproj file.

<Project Sdk="WixToolset.Sdk/4.0.0">
  <PropertyGroup>
    <OutputType>Bundle</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <OutputPath>bin\x64\Debug</OutputPath>
    <TreatWarningsAsErrors>false</TreatWarningsAsErrors>
  </PropertyGroup>
  <ItemGroup>
    <None Include="NDP481-x86-x64-AllOS-ENU.exe" />
  </ItemGroup>
  <ItemGroup>
    <PackageReference Include="WixToolset.Bal.wixext" Version="4.0.0" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\TestSetup\TestSetup.wixproj" />
  </ItemGroup>
</Project>

Read many Wix tutorials and documentation, and I still don't understand the error I experience. Any help greatly appreciated.

Build output:

Build started...

1>------ Skipped Build: Project: Test, Configuration: Debug x64 ------

1>Project not selected to build for this solution configuration

2>------ Skipped Build: Project: TestSetup, Configuration: Debug x64 ------

2>Project not selected to build for this solution configuration

3>------ Build started: Project: TestBundleInstaller, Configuration: Debug x64 ------

Restored C:\Users\JJacobs\source\repos\TestBundleInstaller\TestBundleInstaller.wixproj (in 2 ms).

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

3>Done building project "TestBundleInstaller.wixproj" -- FAILED.

========== Build: 0 succeeded, 1 failed, 0 up-to-date, 2 skipped ==========

Hope it helps.

@jhjacobs
Copy link
Author

Didn't intend to delete the template information.

@BMurri
Copy link

BMurri commented Sep 12, 2023

This is the section of the template that is intended you fill out and leave in place. @jhjacobs you can edit that first box at the top, past this template in there, and fill it out from the information you provided in this comment.

Bugs

If this issue is a bug:

  • Which version of WiX are you building with?

(WiX version in major.minor.release.build format)

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

(Visual Studio version, including year and update)

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

(WiX Toolset Visual Studio Extension version in major.minor.release.build format)

  • Which version of .NET are you building with?

(.NET version)

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

(Windows version)

  • Describe the problem and the steps to reproduce it.

(Be as specific as you can and err on the side of providing too much information, including code, error messages, command lines you used to invoke the build, and so forth.)

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

(Be as specific as you can and err on the side of providing too much information.)

@jhjacobs
Copy link
Author

This code is a very simple test application. I would be happy to zip the entire solution and attach if it is helpful.

@robmen
Copy link
Member

robmen commented Sep 12, 2023

Additional code is not necessary in this case. The example provided is enough to reproduce the issue.

And please do learn from this experience to not vent your frustration at the people working on an OSS project you get for free. Oh, and fill out the templates provided because it helps them (us) more quickly evaluate the issues.

@jhjacobs
Copy link
Author

robmen,

Will do and thanks to all for your effort.

@robmen
Copy link
Member

robmen commented Sep 12, 2023

Root issue: crash happens because ExePackage parsing failed to generate an Id when SourceFile and Name attributes are absent. An error message should have been displayed. The handling of remote payloads makes detecting this error scenario complex.

Work around: add SourceFile attribute to ExePackage.

@barnson barnson added compiler and removed triage labels Sep 19, 2023
@barnson barnson added this to the v5.0.0-preview.1 milestone Sep 19, 2023
@robmen robmen modified the milestones: v5.0.0-rc.1, v.Future Mar 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants