-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dotnet clean
(--all
?) can always fail before a build is run for apps with a RuntimeIdentifier
#30199
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
Comments
@nagilson hi! I want to contribute, can I work on this task? Do I understand correctly that |
@BogdanYarotsky Thank you for your interest in working on the .NET SDK 😄
|
@nagilson thanks for the quick reply! I'll work on the friendly error message then. |
Not as quick as I'd prefer given the long weekend, but thanks 😉 |
Hi @nagilson,
It's necessary to always have a restored project before invoking Other options would be:
What approach do you think would make the most sense? |
Hi @BogdanYarotsky, I am impressed by your investigation -- thank you for taking such a deep dive. Clearly you are very knowledgeable about .NET. 😄 Running We definitely wouldn't take a change with #2 because we want to have reliable behavior. Based on that, I hope that provides you enough to go off of in the short term; I think @baronfel would also be able to chime in here on if he thinks |
So, dotnet restore can require an internet connection, but we don't want clean to require that. I chatted with all of the SDK team and most folks are against adding an implicit restore. I see where you were coming from though and it's a good idea, a lot of things in the SDK are like this unfortunately where the seemingly clear solution breaks other stuff. 😆 We are still in favor of reading the project assets json and erroring / restoring in that condition. Still thinking if there's a better approach. |
Thank you for the detailed response 🙂 |
Awesome, thanks and I look forward to it 😄 |
As reported by @pimbrouwers in: #29859
If you do something like
dotnet new console -lang "F#"
and add aRuntimeIdentifier
to the project and trydotnet clean
, it will fail every time until you rundotnet build
, in which case it will work.This is because clean only cleans the folder for the exact RID, Config, TFM, etc, and there is no
runtime config assets.json
as that is created by build but never cleaned up, clean only cleans the output directory, and relies on this file to do so. We would maybe like to have an error instead of crash, though we could also design adotnet clean --all
which would clean all output... though we are concerned about deleting people's files.The text was updated successfully, but these errors were encountered: