Skip to content

Commit 4769ff2

Browse files
authored
Prevent warning for implicit ILCompiler reference (#79870)
1 parent 0776945 commit 4769ff2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

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

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

0 commit comments

Comments
 (0)