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

New winmd reference enforcement targets wrong items #13233

Open
Scottj1s opened this issue Jun 16, 2020 · 6 comments
Open

New winmd reference enforcement targets wrong items #13233

Scottj1s opened this issue Jun 16, 2020 · 6 comments

Comments

@Scottj1s
Copy link

The csc task uses ReferencePathWithRefAssemblies, rather than ReferencePath:

C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\Roslyn\Microsoft.CSharp.Core.targets(111):
References="@(ReferencePathWithRefAssemblies)"

/cc @jkoritzinsky

@sfoslund sfoslund removed their assignment Jun 26, 2020
@marcpopMSFT marcpopMSFT transferred this issue from dotnet/sdk Jul 15, 2020
@jaredpar
Copy link
Member

That behavior is expected from our perspective. Can you elaborate on why you think this is a bug?

@Scottj1s
Copy link
Author

@jaredpar It presents a false negative. I can try to address a NETSDK11130 by removing ReferencePath items, and _BlockWinMDsOnUnsupportedTFMs will no longer trigger an error. But csc will still receive the winmd references, creating a potentially incorrect assembly.

@jaredpar
Copy link
Member

jaredpar commented Aug 28, 2020

Still not sure how this is a bug in the csc task though. Our MSBuild API is to use this item group as our input for references. This is a design done in collaboration with MSBuild to ensure we get the proper benefits from reference assemblies at build times. Moving to @(ReferencePath) would explicitly go against that design.

It sounds like another target updating the incorrect item group here and that is the source of the issue. Can't tell from the discussion though where this would be occuring.

@Scottj1s
Copy link
Author

There's nothing wrong with the csc task, but with the _BlockWinMDsOnUnsupportedTFMs target

@Scottj1s
Copy link
Author

that may not have been clear in my description. The _BlockWinMDsOnUnsupportedTFMs is targeting the wrong item (ReferencePath) because the csc task refers to ReferencePathWithRefAssemblies

@jaredpar
Copy link
Member

@Scottj1s gotcha. Thanks for the clarification. Moving to SDK as this is one of their targets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants