Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/building-apps/build-properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,9 @@ Default:

## NoBindingEmbedding

> [!WARNING]
> Setting this property to `false` is currently deprecated and will produce a build error in .NET 12+.

A boolean property that specifies whether native libraries in binding projects should be embedded
in the managed assembly, or put into a `.resources` directory next to the managed assembly.

Expand Down
2 changes: 2 additions & 0 deletions msbuild/Xamarin.Shared/Xamarin.Shared.ObjCBinding.targets
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ Copyright (C) 2020 Microsoft. All rights reserved.
</Target>

<Target Name="_PrepareNativeReferences" Condition="'$(_DisableBindingProjectBuild)' != 'true'" DependsOnTargets="_SanitizeNativeReferences">
<Warning Condition="'$(_NoBindingEmbeddingDeprecated)' == 'true'" Text="Setting 'NoBindingEmbedding' to 'false' is deprecated and will not be supported in .NET 12+. Please remove this property from your project file." />
<Error Condition="'$(_NoBindingEmbeddingRemoved)' == 'true'" Text="Setting 'NoBindingEmbedding' to 'false' is not supported in .NET 12+. Please remove this property from your project file." />
<PrepareNativeReferences
IntermediateOutputPath="$(IntermediateOutputPath)"
NativeReferences="@(NativeReference)"
Expand Down
4 changes: 4 additions & 0 deletions msbuild/Xamarin.Shared/Xamarin.Shared.props
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,10 @@ Copyright (C) 2020 Microsoft. All rights reserved.
<!-- Default NoBindingEmbedding to 'true' for .NET projects, it's the new way -->
<NoBindingEmbedding Condition="'$(NoBindingEmbedding)' == ''">true</NoBindingEmbedding>

<!-- NoBindingEmbedding=false is deprecated in .NET 10, and removed in .NET 12+ -->
<_NoBindingEmbeddingDeprecated Condition="'$(NoBindingEmbedding)' != 'true' And !$([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 12.0))">true</_NoBindingEmbeddingDeprecated>
<_NoBindingEmbeddingRemoved Condition="'$(NoBindingEmbedding)' != 'true' And $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 12.0))">true</_NoBindingEmbeddingRemoved>
Comment thread
rolfbjarne marked this conversation as resolved.

<!-- We don't want to build a binding project when in design time mode, and not bundling original resources, because we might end up requiring a connection to a remote mac, which is not a good idea for a supposedly quick design-time build. -->
<_DisableBindingProjectBuild Condition="'$(_DisableBindingProjectBuild)' == '' And '$(BundleOriginalResources)' != 'true' And '$(DesignTimeBuild)' == 'true'">true</_DisableBindingProjectBuild>
</PropertyGroup>
Expand Down