-
Notifications
You must be signed in to change notification settings - Fork 252
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
PackageReference does not treat build and contentFiles same to lib/ref - leading to unintuitive asset selection #6908
Comments
@rido-min |
Discussed via e-mail with @rido-min The package structure is as follows:
The root cause is that in the compatibility checker we consider every package without assemblies to be compatible.
This indicates that this is by design. The workaround/recommended approach for such packages is to have a placeholder in the lib folder
It's a common pattern seen in a lot of packages. //cc @rrelyea @jainaashish @emgarten |
That is correct and the right workaround. I believe this was first done since a compat failure for meta packages would be incorrect. In my opinion it would be correct for build and contentFiles to be treated the same as the lib folder and fail. This code was ported over from DNU which didn't have other asset types like this and the issue wasn't caught until much later after shipping (few people complain about not getting failures). In the past we've opted to continue leaving build/contentFiles out of the compat check here to avoid breaking existing packages. |
I'm validating a package install with a dependency to net462.
Using packages.config, installing in a project targeting net461 fails (as expected) with:
However when installing the same package in the same project using PackageRef the package is installed without any error or warning.
The text was updated successfully, but these errors were encountered: