Skip to content

Commit b1c05cc

Browse files
committed
[dotnet] Only set PublishAotUsingRuntimePack=true if we're actually publishing.
.NET now shows an error if PublishAotUsingRuntimePack=true and PublishAot=true, but we're not actually publishing: > Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Publish.targets(231): error NETSDK1225: Native compilation is not supported when invoking the Publish target directly. Try running dotnet publish. Ref: dotnet/sdk#46070
1 parent 2b650d5 commit b1c05cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dotnet/targets/Xamarin.Shared.Sdk.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,6 @@
187187
<PropertyGroup Condition="'$(PublishAot)' == 'true'">
188188
<!-- This turns off some NativeAOT logic we don't want nor need -->
189189
<NativeCompilationDuringPublish>false</NativeCompilationDuringPublish>
190-
191-
<!-- We must find the BCL libraries using the runtime pack instead of using the built-in NativeAOT BCL -->
192-
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
193190
</PropertyGroup>
194191
<PropertyGroup Condition="'$(PublishAot)' == 'true' And '$(_IsPublishing)' == 'true'">
195192
<!-- Disable our own assembly IL stripping logic, because ILC does that already -->
@@ -202,5 +199,8 @@
202199
we are only setting this flag when we are building executables. (Class libraries do not have a managed Main)
203200
-->
204201
<CustomNativeMain Condition="'$(OutputType)' == 'Exe'">true</CustomNativeMain>
202+
203+
<!-- We must find the BCL libraries using the runtime pack instead of using the built-in NativeAOT BCL -->
204+
<PublishAotUsingRuntimePack>true</PublishAotUsingRuntimePack>
205205
</PropertyGroup>
206206
</Project>

0 commit comments

Comments
 (0)