diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 2c1e91afc8ba16..a65bd556853f82 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -157,8 +157,16 @@ The .NET Foundation licenses this file to you under the MIT license. - - + + <_IlcIntermediateAssemblyNames>@(IntermediateAssembly->'%(Filename)%(Extension)', ';') + <_WrappedIlcIntermediateAssemblyNames>;$(_IlcIntermediateAssemblyNames); + + + + <_ResolvedManagedBinary Include="@(ResolvedFileToPublish)" + Condition="'%(ResolvedFileToPublish.PostprocessAssembly)' == 'true' and $(_WrappedIlcIntermediateAssemblyNames.Contains(';%(ResolvedFileToPublish.Filename)%(ResolvedFileToPublish.Extension);'))" /> + +