-
Notifications
You must be signed in to change notification settings - Fork 1.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
On dotnet publish for Mac, getting unclear error "error MSB4018: The "GenerateDepsFile" task failed unexpectedly... System.InvalidOperationException: Unrecognized AssetType 'resource' " #40015
Comments
After some deep look and discussions with developers in my team, turns out that we did some non standard stuff in the consumed package. I'm leaving this bug opened just in case you find it interesting for any other reasons, feel free to close if not. |
Triage: We'll close for now and we if we get more feedback around improving the error experience for malformed packages, we can take a look in the future. |
@nkolev92 It looks like here an invalid asset type ( |
I see the 3 types being added as The SDK seems to have been using
I'm guessing The "safe" approach might be for the SDK to support both, but given that NuGet and SDK seems to have been looking at a different thing at least 3 years back, not sure there's a big risk if NuGet changed. This is all the product of a short investigation, so I could be missing something. |
I created a PR with the "safer" fix, that won't add any backward compatibility issues. I'd appreciate your feedback on it. If it is accepted, we'd like it to be backported to 8.* (preferably 8.0.401), and naturally also 9.* |
For completeness: |
…'resources' Fixes #40015
Describe the bug
When trying to
dotnet publish
a project with dependencies, I'm getting the MSBuild exception below.Based on looking at dotnet code, I guess that the error is probably due to some typo in the package creation, where instead of
resources
, the wordresource
was used (I understood it by the code around the exception thrown here:https://github.com/dotnet/sdk/blob/a1fdd359f85eaa8a7ebb68b4856b0dc559543a93/src/Tasks/Microsoft.NET.Build.Tasks/ResolvedFile.cs#L75C17-L76C1)
However I can't I understand from the exception and the code around where should I look for that typo in our code or even in the binary or package metadata.
Short term - please advice what exactly should I look at.
Long term - consider providing clearer error message.
To Reproduce
Dependency tree is complex and due to the unclear error message I don't know how to minimize the code into simple repro, sorry.
On private call I'll be able to provide the faulty package and to share the environment where I reproduced the bug.
Exceptions (if any)
(Obfuscated some private paths from the logs below)
Further technical details
No IDE, running the following line from command line:
dotnet publish --interactive -c Debug-Mac -f net8.0 <project-path>
The text was updated successfully, but these errors were encountered: