Skip to content

Commit 7ac78d2

Browse files
authored
Prevent warning for implicit ILCompiler reference (#79240)
1 parent 45f5e85 commit 7ac78d2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@
4242
<!-- Generate a warning if the non-SDK path is used -->
4343
<Target Name="GenerateILCompilerExplicitPackageReferenceWarning" Condition="'$(SuppressGenerateILCompilerExplicitPackageReferenceWarning)' == '' and '$(AotRuntimePackageLoadedViaSDK)' != 'true' and '$(ILCompilerTargetsPath)' != '' and '$(NeedNativePublishSupportForSDK6)' != 'true'"
4444
BeforeTargets="ImportRuntimeIlcPackageTarget">
45-
<Warning Text="Delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file. Explicit 'Microsoft.DotNet.ILCompiler' package reference can run into version errors." />
45+
<Warning Condition="'%(PackageReference.Identity)' == 'Microsoft.DotNet.ILCompiler' And '%(PackageReference.IsImplicitlyDefined)' != 'true'"
46+
Text="Delete explicit 'Microsoft.DotNet.ILCompiler' package reference in your project file. Explicit 'Microsoft.DotNet.ILCompiler' package reference can run into version errors." />
4647
</Target>
4748

4849
<!-- Locate the runtime package according to the current target runtime -->

0 commit comments

Comments
 (0)