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

msbuild clean wrong files during compilation #11364

Open
payn-git opened this issue Jan 31, 2025 · 1 comment
Open

msbuild clean wrong files during compilation #11364

payn-git opened this issue Jan 31, 2025 · 1 comment

Comments

@payn-git
Copy link

Issue Description

We have below structure in repository. When we are compiling individual folder solutions separately everything works correctly. We have also combined solution which contains all projects from all folders. If we will compile that solution everything works correctly. However, if we will compile combined solution first (compile correctly), and then we will compile just project2 (some code changes), msbuild will delete files which are part of the project1 from output directory even if project1 was not compiled at all. It seems that project2 FileListAbsolute.txt in obj compilation folder contain list of files from Project1 (probably generated when combined solution was compiled ?). As files which are not part of compiled solution are deleted from target location application will not start anymore. We have to go back and recompile Folder1 solution again. This is affecting productivity a lot and if people are not aware about this, they even spend lot of time investigating why those files are disappearing.

Please see attached binary log from compilation. Im not able to attach projects\solutions for reproducibility as those are protected IP.

Image

msbuild.DeletingWrongFiles.zip

MI.Biz.Plugin.Registration.csproj.FileListAbsolute.txt

Folder1

  • projects1
    • xml files in output dir
  • solution for Folder1

Folder2

  • projects2
    • dependency on project1
  • solution for Folder2

CombinedSolution (Folder1\Folder2)

Steps to Reproduce

Compile combined solution first. Compile individual projects afterwards.

Expected Behavior

Files which are not related\owned by compiled project\solution should not be deleted from compilation output directory.

Actual Behavior

Files which are not part of compiled project\solution are deleted from compilation output directory.

Analysis

No response

Versions & Configurations

MSBuild version 17.12.12+1cce77968 for .NET Framework
17.12.12.57101

@payn-git
Copy link
Author

Adding binary log for combined solution compilation which will lead to situation where Project2 FileListAbsolute.txt contains files which are not part of the project itself.

CombinedSolution.zip

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

1 participant