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

Display appropriate error message when providing syntactically incorrect MSBUILD flags to dotnet pack #38645

Closed
Matheos96 opened this issue Feb 9, 2024 · 4 comments
Assignees
Labels
untriaged Request triage from a team member

Comments

@Matheos96
Copy link

Is your feature request related to a problem? Please describe.

This had me baffled for a while. Basically I was trying to package a nuget package using dotnet pack by replicating what we do in our CI/CD pipeline. I did not copy the commands correctly, so when running the dotnet pack command I had a small syntactical error in providing the MsBuild PackageVersion property... See it?
image
I did not see anything wrong with this for quite some time. Obviously it should be -p:PackageVersion=8.0.0.0 with an equals sign, not a semi-colon. I noticed it when I actually copied the command straight off but I had the faulty one in my CLI history and could not figure out why it would be there if not working...

The dotnet pack output tells me close to nothing. I even tried running it with -v diag verbosity to see EVERYTHING but that still did not indicate anything what could have gone wrong...

image

Describe the solution you'd like

Please consider adopting some syntactical checking for these -p:PropertyName=Value flags. At the very least tell me that something went wrong, even if I would not know what. There is no error, no red text, nothing. Only through experience I knew I expected more of an output (and of course the .nupkg itself). The console output in no way indicates an error has occurred.

Additional context

I realise it may be a challenge to get a very friendly syntax related error message done, probably due to how the command is parsed? I would like to see something though, even just red text saying it failed. Imagine this being in a pipeline and you quickly go through everything trying to figure out why your package has not been published. There is no blatant error anywhere

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Feb 9, 2024
Copy link

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.

@Forgind
Copy link
Member

Forgind commented Jun 18, 2024

@Matheos96,

Thanks for filing this! I actually caught an almost identical bug a while ago. Can you clarify what version of the SDK/MSBuild you're using? I believe this should be 90% better after dotnet/msbuild#9570, and for the remaining 10%, it's essentially the same as #37230.

Closing in favor of #37230, but I'll make that one a little more broad. And if you're seeing this with a recent version of MSBuild, it might be good to let the MSBuild team know 🙂

@Forgind Forgind closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@Matheos96
Copy link
Author

Matheos96 commented Jun 19, 2024

Can you clarify what version of the SDK/MSBuild you're using?

@Forgind Ok, great! As you can see from the screenshots, I used .NET 8.0.101 SDK.

I can't see from the PR, maybe just missing it, but what SDK version will include dotnet/msbuild#9570?

@Forgind
Copy link
Member

Forgind commented Jun 19, 2024

Can you clarify what version of the SDK/MSBuild you're using?

@Forgind Ok, great! As you can see from the screenshots, I used .NET 8.0.101 SDK.

🤦 I can be blind sometimes; you're totally right

I can't see from the PR, maybe just missing it, but what SDK version will include dotnet/msbuild#9570?

That looks like it was merged in January, so it most likely ended up in 17.10 MSBuild, which went into the 8.0.3xx SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

2 participants