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

[Bug]: Build failed. Properties, Items, and Target results cannot be obtained. See details in stderr above. #9339

Closed
nojaf opened this issue Oct 18, 2023 · 8 comments · Fixed by #9345
Labels
bug needs-triage Have yet to determine what bucket this goes in.

Comments

@nojaf
Copy link

nojaf commented Oct 18, 2023

Issue Description

I'm trying to get the values of the ReferencePathWithRefAssemblies after a dotnet restore

Steps to Reproduce

Expected Behavior

I'm not sure this property exists, this is a bit of a hunch at this point.
At the very least, it should not error I think.

I'm having the same problem with dotnet restore -f --getTargetResult:Restore

Actual Behavior

Build failed. Properties, Items, and Target results cannot be obtained. See details in stderr above.

Analysis

I'm trying to get the resolved assemblies that are invoking dotnet restore.

Versions & Configurations

dotnet --version

8.0.100-rc.2.23502.2

dotnet msbuild --version

MSBuild version 17.8.0+6cdef4241 for .NET
17.8.0.47204

@nojaf nojaf added bug needs-triage Have yet to determine what bucket this goes in. labels Oct 18, 2023
@rainersigwald
Copy link
Member

This looks pretty interesting, but the first thing that jumps out at me is dotnet restore --getProperty is a bit unusual, since it'll specify targets to build (that's how restore is done) and also request that property.

Was there any output to stderr?

This isn't a good error experience, which we should look at--but if you describe what you want in slightly more detail we may be able to help you out.

@rainersigwald
Copy link
Member

cc @Forgind, @baronfel

@nojaf
Copy link
Author

nojaf commented Oct 18, 2023

There was no additional output:

image

Although, I guess I might need some additional flags to see this?

@rainersigwald
Copy link
Member

you shouldn't!

@baronfel
Copy link
Member

Can you add -bl to that invocation and see if there are any more error details in the binlog?

@nojaf
Copy link
Author

nojaf commented Oct 18, 2023

msbuild.binlog.zip

There are no errors in the bin log at first glance.

@Forgind
Copy link
Member

Forgind commented Oct 18, 2023

Ok; I think I figured out what went wrong here. If you restore only (0 other targets), it skips adding the ProvideProjectStateAfterBuild flag. I'll look into how to resolve that momentarily.

rainersigwald pushed a commit that referenced this issue Oct 19, 2023
We need the built project to get the post-build results from it when using get* switches. They were almost always retained, but we didn't keep them if "RestoreOnly" was true. Fixes #9339.
@nojaf
Copy link
Author

nojaf commented Oct 19, 2023

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-triage Have yet to determine what bucket this goes in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants