tunnelvisionlabs / ReferenceAssemblyAnnotator

IL weaver to add nullability annotations to .NET reference assemblies
MIT License
72 stars 8 forks source link

NETSDK1022 error for default compile items when using WPF with .NET 6 SDK caused by our workaround for earlier SDKs #89

Open jnm2 opened 2 years ago

jnm2 commented 2 years ago

I'm reproing:

Error NETSDK1022: Duplicate 'Compile' items were included. The .NET SDK includes 'Compile' items from your project directory by default. You can either remove these items from your project file, or set the 'EnableDefaultCompileItems' property to 'false' if you want to explicitly include them in your project file. For more information, see https://aka.ms/sdkimplicititems. The duplicate items were: 'C:\Users\Joseph.nuget\packages\tunnelvisionlabs.referenceassemblyannotator\1.0.0-alpha.160\build\NullableAttributes.cs'

And I think this could be https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/pull/82 causing problems now that the .NET 6 SDK fixed the problem we were working around. <IncludePackageReferencesDuringMarkupCompilation> is on by default starting with SDK 6, and we should have a CI test with and also without.

jnm2 commented 2 years ago

Moving this repo to use the .NET 6 SDK repros this problem immediately (https://github.com/tunnelvisionlabs/ReferenceAssemblyAnnotator/compare/master...jnm2:sdk_6)

chucker commented 2 years ago

See also https://github.com/manuelroemer/IsExternalInit/pull/11.

Seems to me the property is indeed the correct fix.