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

FastUpToDate: Up-to-date check threw System.ArgumentNullException for wix4 project #9348

Open
svg2003 opened this issue Dec 2, 2023 · 3 comments
Assignees
Labels
Feature-Up-to-date Build up-to-date check that avoids shelling out to MSBuild unless necessary. Triage-Approved Reviewed and prioritized
Milestone

Comments

@svg2003
Copy link

svg2003 commented Dec 2, 2023

Visual Studio Version

Version 17.7.7

Summary

TestWix4Package.zip

For wix4 project, FastUpToDate throws below exception.
Looking on place, MsBuildProjectDirectory is null, albeit ProjectTargetPath contains correct value.

This is in MSVS output

Build started...
1>FastUpToDate: Up-to-date check threw an exception. Not up-to-date. System.ArgumentNullException: Value cannot be null.
1>Parameter name: path1
1>   at System.IO.Path.Combine(String path1, String path2)
1>   at Microsoft.VisualStudio.ProjectSystem.UpToDate.BuildUpToDateCheck.<>c__DisplayClass44_0.<<IsUpToDateInternalAsync>g__CheckAsync|0>d.MoveNext() (TestWix4Package)
1>FastUpToDate: Up-to-date check completed in 67.5 ms (TestWix4Package)

https://github.com/dotnet/project-system/blob/main/src/Microsoft.VisualStudio.ProjectSystem.Managed.VS/ProjectSystem/VS/UpToDate/BuildUpToDateCheck.cs#L1084

Steps to Reproduce

  1. Create new project from standard template: "MSI Package (Wix v4)"
  2. Try to build that project

Expected Behavior

No exception, and fastuptodate works for wix projects

Actual Behavior

Since fastcheck doesn't work, projects are constantly rebuilds
TestWix4Package.zip

User Impact

@adamint
Copy link
Member

adamint commented Dec 14, 2023

@drewnoakes assigning you, if that's alright.

@adamint adamint added the Triage-Approved Reviewed and prioritized label Dec 14, 2023
@jeremy-visionaid
Copy link

I'm seeing this too. Curiously, setting <DisableFastUpToDateCheck>True</DisableFastUpToDateCheck> has no effect either.

@drewnoakes drewnoakes added the Feature-Up-to-date Build up-to-date check that avoids shelling out to MSBuild unless necessary. label Mar 19, 2024
@drewnoakes
Copy link
Member

As @svg2003 says, the exception's coming from here:

string outputFullPath = Path.Combine(implicitState.MSBuildProjectDirectory, implicitState.OutputRelativeOrFullPath);

Both implicitState.MSBuildProjectDirectory and implicitState.OutputRelativeOrFullPath are nullable, yet Path.Combine disallows null arguments.

We need to understand why those values might be null for WIX projects (or in general). And in cases where they are null, we need to decide what to do about it. For example, should we just declare the project out-of-date? Or should we just skip certain checks?

The same problem exists higher up in the file, in:

string outputFullPath = Path.Combine(state.MSBuildProjectDirectory, state.OutputRelativeOrFullPath);

@drewnoakes drewnoakes added this to the 17.11 milestone Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature-Up-to-date Build up-to-date check that avoids shelling out to MSBuild unless necessary. Triage-Approved Reviewed and prioritized
Projects
None yet
Development

No branches or pull requests

4 participants