-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comments
Repro it and binlog msbuild.binlog.txt |
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. |
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. |
Note, this is not necessarily the same issue as the one linked above just now. In this issue, the problem is a Native DLL project. In my issue, the problem is with nuget package Microsoft.Data.SqlClient.SNI copying Native DLLs from its buildTransitive folder to the build output directory, but subsequently gets deleted by IncrementalClean. If a member of the nuget team can explain how does nuget normally handle this, I can try to pitch in and fix this. I tried to find the nuget targets that control restore but no success yet. I plan to search everywhere FileWrites is mentioned in my sdk path. It does seem like there should be a simple item collection that automatically gets added to FileWrites by the Build step, or similar. As a simple thought, the item collection could be called |
Issue Description
I have a
WPF
exe project referencing aLibrary
project which in turn references aNative DLL
project. See attached sample project.When rebuilding the solution, the output folder of the exe project contains all binaries:
Then, perform any code change in the
WpfApp2
project and Build it (F7
on my setup). TheNativeLib.dll
gets deleted. Using verbose logging, I can see that it incorrectly gets picked up in_CleanOrphanFileWritesInOutput
processed by theIncrementalClean
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
The text was updated successfully, but these errors were encountered: