-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Regression in 5.0.20x SDK when building with --no-dependencies #16299
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
I think your analysis of what's going on is accurate. We don't think this rises in priority to the level of us fixing this for the upcoming releases. |
Which upcoming releases are you referring to? A 5.0.2xx/5.0.3xx release, or .NET 6? |
I've tried working on a fix but ultimately I'm stuck. I'd like to start by saying I absolutely love the test framework here and it made writing the test surprisingly easy. Good job! Finding a fix for the problem was more tricky. The test showed that initial analysis above was not entirely correct:
My attempt so far can be found here: main...yaakov-h:yaakov/fix16299 The approach that I want to take is quite simple: If the SDK is asked to copy a file from our own output directory we skip copying it. This is because:
Unfortunately, while I can skip copying it, I can't figure out how to stop cleaning it. Therefore, even though my dependent project now builds, the necessary files still get deleted and the referenced project's output won't run. Unless I can skip deleting the files too, this approach won't get anywhere. Another approach, which would possibly be more correct: I have noticed that the SDK is smart enough to not delete the It looks like that decision is made somewhere else, not in this repo (possibly in MSBuild repo?) so I can't see how to extend that check. If we can include these files in the set of files related to the assembly that we already know not to delete, then the problem should similarly disappear. Any suggestions? |
When building a project with
--no-dependencies
that references another project, when both projects build to the same output directory, the SDK deletes the.deps.json
,.runtimeconfig.dev.json
, and.runtimeconfig.json
files during the build process and then produces errors because those files could not be copied (as they do not exist).Repro repository: https://github.com/yaakov-h/dotnetsdk5.20x-error
To reproduce this, clone the above repository and then run
.\build.ps1
. Output for me is:(The additional
--no-*
arguments in the build script are not necessary to trigger the failure, but I included them in the test case because that is how we build our projects.)This project builds successfully with the .NET 5.0.103 and 5.0.104 SDKs, but fails on the .NET 5.0.200 and 5.0.201 SDKs.
I suspect this was caused by #14488.
My suspicion is that additional json files for
My.Cool.Website
are now being considered as output ofMy.Cool.Website.Tests
, so it includes them in the Clean build target towards the very beginning of the build.The text was updated successfully, but these errors were encountered: