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

[Broken Build]: Native DLL output deleted on IncrementalClean #10931

Open
znakeeye opened this issue Nov 4, 2024 · 3 comments
Open

[Broken Build]: Native DLL output deleted on IncrementalClean #10931

znakeeye opened this issue Nov 4, 2024 · 3 comments
Assignees

Comments

@znakeeye
Copy link

znakeeye commented Nov 4, 2024

Issue Description

I have a WPF exe project referencing a Library project which in turn references a Native DLL project. See attached sample project.

When rebuilding the solution, the output folder of the exe project contains all binaries:

MyLib.dll
NativeLib.dll
WpfApp2.dll
WpfApp2.exe

Then, perform any code change in the WpfApp2 project and Build it (F7 on my setup). The NativeLib.dll gets deleted. Using verbose logging, I can see that it incorrectly gets picked up in _CleanOrphanFileWritesInOutput processed by the IncrementalClean target.

Steps to Reproduce

See attached sample project.

SimpleApp.zip

Expected Behavior

Native DLL output should not be deleted when building solution.

Actual Behavior

Native DLL output is deleted when building solution.

In real-world solutions, this causes runtime errors. We have spent many days trying to debug issues that weren't real issues; the build is in fact broken.

Ask us questions

No response

@JaynieBai JaynieBai self-assigned this Nov 6, 2024
@JaynieBai
Copy link
Member

Repro it and binlog msbuild.binlog.txt

@yuehuang010
Copy link
Contributor

Generally, the task/target that copies the NativeLib.dll to the output directory should also append to the "FileWrite" ItemGroup so that the Incremental Clean step won't delete it.

I wonder if this is the bug where building from the IDE and command line has different behavior.

@KalleOlaviNiemitalo
Copy link

It's "FileWrites", plural.

Which is not consistent with item types like "Compile" having been named with the singular form, but too late to change now.

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

No branches or pull requests

5 participants