From 7346e246b5da22dade802d32bfc956d3ad813b18 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Mon, 17 Mar 2025 10:05:15 -0700
Subject: [PATCH 01/13] Fix mac binary

---
 src/redist/redist.csproj | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj
index 1031db7b..af3c9caa 100644
--- a/src/redist/redist.csproj
+++ b/src/redist/redist.csproj
@@ -9,7 +9,7 @@
 
   <ItemGroup>
     <ProjectReference Include="..\dotnet-core-uninstall\dotnet-core-uninstall.csproj" />
-    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="10.0.0-beta.25124.4"/>
+    <PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" Version="10.0.0-beta.25124.4" Condition="'$(RID)' == 'win-x86'"/>
   </ItemGroup>
 
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\Versions.targets" />

From fb9f2aa5fc242f71e98fb93b3520ef077562fd26 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Mon, 17 Mar 2025 13:29:01 -0700
Subject: [PATCH 02/13] Temp disable signing to test mac binary

---
 .vsts-ci.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index 08294b2a..868a89ab 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -145,7 +145,7 @@ extends:
                 -sign 
                 --configuration $(_BuildConfig)
                 --prepareMachine
-                -p:RID=$(_RID) -p:DotNetSignType=real -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
+                -p:RID=$(_RID) -p:DotNetSignType=test -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
               displayName: Build
             - task: ArchiveFiles@2
               condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))

From e19c4f737384e25c618ec0b42c4c608c9580ce34 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Mon, 17 Mar 2025 14:49:02 -0700
Subject: [PATCH 03/13] Remove itemstosign temporarily

---
 eng/Signing.props | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eng/Signing.props b/eng/Signing.props
index 0bbc5e60..258fa825 100644
--- a/eng/Signing.props
+++ b/eng/Signing.props
@@ -9,9 +9,9 @@
       $(ArtifactsDir)packages\**\dotnet-core-uninstall*.msi;" />
   </ItemGroup>
 
-  <ItemGroup Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'">
+  <!-- <ItemGroup Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'">
     <FileSignInfo Include="dotnet-core-uninstall" CertificateName="MacDeveloperHarden" />
     <FileSignInfo Include="dotnet-core-uninstall.pdb" CertificateName="MacDeveloperHarden" />
     <ItemsToSign Include="$(ArtifactsDir)layout/dotnet-core-uninstall/*" />
-  </ItemGroup>
+  </ItemGroup> -->
 </Project>

From 734192c558554a657109b6d4a32b77b5180ad4a1 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Mon, 17 Mar 2025 16:01:48 -0700
Subject: [PATCH 04/13] Do not sign

---
 .vsts-ci.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index 868a89ab..69ecee4b 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -142,7 +142,6 @@ extends:
             - checkout: self
               clean: true
             - script: eng/common/cibuild.sh
-                -sign 
                 --configuration $(_BuildConfig)
                 --prepareMachine
                 -p:RID=$(_RID) -p:DotNetSignType=test -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)

From dbd183687f063e79c11bf88e3ab2c8f2014cd49c Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Tue, 18 Mar 2025 11:39:38 -0700
Subject: [PATCH 05/13] Add entitlements.plist

---
 .vsts-ci.yml           |  4 +++-
 eng/entitlements.plist | 14 ++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 eng/entitlements.plist

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index 69ecee4b..a4b8a2cf 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -142,9 +142,11 @@ extends:
             - checkout: self
               clean: true
             - script: eng/common/cibuild.sh
+                --sign
                 --configuration $(_BuildConfig)
                 --prepareMachine
-                -p:RID=$(_RID) -p:DotNetSignType=test -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
+                --entitlements eng/entitlements.plist
+                -p:RID=$(_RID) -p:DotNetSignType=real -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
               displayName: Build
             - task: ArchiveFiles@2
               condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
diff --git a/eng/entitlements.plist b/eng/entitlements.plist
new file mode 100644
index 00000000..a3acd163
--- /dev/null
+++ b/eng/entitlements.plist
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+    <key>com.apple.security.cs.allow-jit</key>
+    <true/>
+    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
+    <true/>
+    <key>com.apple.security.cs.disable-library-validation</key>
+    <true/>
+    <key>com.apple.security.cs.disable-executable-page-protection</key>
+    <true/>
+</dict>
+</plist>
\ No newline at end of file

From ea5afb942c51f0367fa3c76d0c79da93d20f0419 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Tue, 18 Mar 2025 12:00:44 -0700
Subject: [PATCH 06/13] Add CodeSignEntitlements

---
 .vsts-ci.yml                                           | 1 -
 src/dotnet-core-uninstall/dotnet-core-uninstall.csproj | 1 +
 {eng => src/dotnet-core-uninstall}/entitlements.plist  | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename {eng => src/dotnet-core-uninstall}/entitlements.plist (100%)

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index a4b8a2cf..d7544763 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -145,7 +145,6 @@ extends:
                 --sign
                 --configuration $(_BuildConfig)
                 --prepareMachine
-                --entitlements eng/entitlements.plist
                 -p:RID=$(_RID) -p:DotNetSignType=real -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
               displayName: Build
             - task: ArchiveFiles@2
diff --git a/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj b/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
index fd483523..84c65843 100644
--- a/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
+++ b/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
@@ -6,6 +6,7 @@
     <SignAssembly>true</SignAssembly>
     <TargetFramework>net8.0</TargetFramework>
     <RollForward>LatestMajor</RollForward>
+    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
   </PropertyGroup>
 
   <PropertyGroup>
diff --git a/eng/entitlements.plist b/src/dotnet-core-uninstall/entitlements.plist
similarity index 100%
rename from eng/entitlements.plist
rename to src/dotnet-core-uninstall/entitlements.plist

From 4a843555fa5ef10fe85bd093bbccf839969ae0ff Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Tue, 18 Mar 2025 12:16:50 -0700
Subject: [PATCH 07/13] Re add files to sign

---
 eng/Signing.props | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/eng/Signing.props b/eng/Signing.props
index 258fa825..0bbc5e60 100644
--- a/eng/Signing.props
+++ b/eng/Signing.props
@@ -9,9 +9,9 @@
       $(ArtifactsDir)packages\**\dotnet-core-uninstall*.msi;" />
   </ItemGroup>
 
-  <!-- <ItemGroup Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'">
+  <ItemGroup Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'">
     <FileSignInfo Include="dotnet-core-uninstall" CertificateName="MacDeveloperHarden" />
     <FileSignInfo Include="dotnet-core-uninstall.pdb" CertificateName="MacDeveloperHarden" />
     <ItemsToSign Include="$(ArtifactsDir)layout/dotnet-core-uninstall/*" />
-  </ItemGroup> -->
+  </ItemGroup>
 </Project>

From 74f3cb07b6588980fdd82f1629bc8f9104ddeb0e Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 09:54:09 -0700
Subject: [PATCH 08/13] Add manual codesign with entitlements

---
 .../dotnet-core-uninstall.csproj               |  1 -
 .../entitlements.plist                         | 18 ++++++++++--------
 src/redist/redist.csproj                       |  4 ++++
 3 files changed, 14 insertions(+), 9 deletions(-)
 rename src/{dotnet-core-uninstall => redist}/entitlements.plist (53%)

diff --git a/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj b/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
index 84c65843..fd483523 100644
--- a/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
+++ b/src/dotnet-core-uninstall/dotnet-core-uninstall.csproj
@@ -6,7 +6,6 @@
     <SignAssembly>true</SignAssembly>
     <TargetFramework>net8.0</TargetFramework>
     <RollForward>LatestMajor</RollForward>
-    <CodesignEntitlements>Entitlements.plist</CodesignEntitlements>
   </PropertyGroup>
 
   <PropertyGroup>
diff --git a/src/dotnet-core-uninstall/entitlements.plist b/src/redist/entitlements.plist
similarity index 53%
rename from src/dotnet-core-uninstall/entitlements.plist
rename to src/redist/entitlements.plist
index a3acd163..2b7e8d11 100644
--- a/src/dotnet-core-uninstall/entitlements.plist
+++ b/src/redist/entitlements.plist
@@ -1,14 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 <plist version="1.0">
-<dict>
+  <dict>
     <key>com.apple.security.cs.allow-jit</key>
-    <true/>
-    <key>com.apple.security.cs.allow-unsigned-executable-memory</key>
-    <true/>
+      <true/>
+    <key>com.apple.security.cs.allow-dyld-environment-variables</key>
+      <true/>
     <key>com.apple.security.cs.disable-library-validation</key>
-    <true/>
-    <key>com.apple.security.cs.disable-executable-page-protection</key>
-    <true/>
-</dict>
+      <true/>
+    <key>com.apple.security.cs.debugger</key>
+      <true/>
+    <key>com.apple.security.get-task-allow</key>
+      <true/>
+  </dict>
 </plist>
\ No newline at end of file
diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj
index af3c9caa..4ab3d0ac 100644
--- a/src/redist/redist.csproj
+++ b/src/redist/redist.csproj
@@ -19,4 +19,8 @@
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\FileExtensions.targets" />
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\GenerateMSIs.targets" />
   <Target Condition="'$(RID)' == 'win-x86'" Name="GenerateMSIs" AfterTargets="Build" DependsOnTargets="GenerateLayout;GenerateDotnetCoreUninstallMsi" />
+
+  <Target Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Name="AddEntitlements" AfterTargets="GenerateLayout">
+    <Exec Command="codesign -s - -f --entitlements $(MSBuildThisFileDirectory)entitlements.plist $(ArtifactsDir)layout/dotnet-core-uninstall/dotnet-core-uninstall" />
+  </Target>
 </Project>
\ No newline at end of file

From 6567350257a82ec8e23a6a190a7e1a985e5f5ccc Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 10:22:30 -0700
Subject: [PATCH 09/13] Add run command

---
 .vsts-ci.yml                                  | 3 ++-
 src/redist/redist.csproj                      | 6 ++----
 src/redist/targets/AddMacEntitlements.targets | 6 ++++++
 3 files changed, 10 insertions(+), 5 deletions(-)
 create mode 100644 src/redist/targets/AddMacEntitlements.targets

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index d7544763..22cf7e48 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -163,4 +163,5 @@ extends:
                 ArtifactName: 'drop-$(_RID)'
                 publishLocation: 'Container'
                 parallel: true
-
+            - script: artifacts/layout/dotnet-core-uninstall/dotnet-core-uninstall -h
+              displayName: Run
\ No newline at end of file
diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj
index 4ab3d0ac..18320b1b 100644
--- a/src/redist/redist.csproj
+++ b/src/redist/redist.csproj
@@ -19,8 +19,6 @@
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\FileExtensions.targets" />
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\GenerateMSIs.targets" />
   <Target Condition="'$(RID)' == 'win-x86'" Name="GenerateMSIs" AfterTargets="Build" DependsOnTargets="GenerateLayout;GenerateDotnetCoreUninstallMsi" />
-
-  <Target Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Name="AddEntitlements" AfterTargets="GenerateLayout">
-    <Exec Command="codesign -s - -f --entitlements $(MSBuildThisFileDirectory)entitlements.plist $(ArtifactsDir)layout/dotnet-core-uninstall/dotnet-core-uninstall" />
-  </Target>
+  <Import Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Project="targets\AddMacEntitlements.targets" />
+  
 </Project>
\ No newline at end of file
diff --git a/src/redist/targets/AddMacEntitlements.targets b/src/redist/targets/AddMacEntitlements.targets
new file mode 100644
index 00000000..e6d6a228
--- /dev/null
+++ b/src/redist/targets/AddMacEntitlements.targets
@@ -0,0 +1,6 @@
+<Project>
+    <!-- This is needed as Arcade signing does not add entitlements. This generates an ad-hoc signature with entitlements that would later be replaced by the actual signature. -->
+    <Target Name="AddEntitlements" AfterTargets="GenerateLayout">
+        <Exec Command="codesign -s - -f --entitlements $(MSBuildThisFileDirectory)entitlements.plist $(ArtifactsDir)layout/dotnet-core-uninstall/dotnet-core-uninstall" />
+    </Target>
+</Project>
\ No newline at end of file

From fa5b967d97469a3346950a4162245f7c7f016c6f Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 11:35:39 -0700
Subject: [PATCH 10/13] Move entitlements.plist

---
 src/redist/redist.csproj                                        | 2 +-
 .../targets/{ => MacEntitlements}/AddMacEntitlements.targets    | 0
 src/redist/{ => targets/MacEntitlements}/entitlements.plist     | 0
 3 files changed, 1 insertion(+), 1 deletion(-)
 rename src/redist/targets/{ => MacEntitlements}/AddMacEntitlements.targets (100%)
 rename src/redist/{ => targets/MacEntitlements}/entitlements.plist (100%)

diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj
index 18320b1b..f7cc398c 100644
--- a/src/redist/redist.csproj
+++ b/src/redist/redist.csproj
@@ -19,6 +19,6 @@
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\FileExtensions.targets" />
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\GenerateMSIs.targets" />
   <Target Condition="'$(RID)' == 'win-x86'" Name="GenerateMSIs" AfterTargets="Build" DependsOnTargets="GenerateLayout;GenerateDotnetCoreUninstallMsi" />
-  <Import Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Project="targets\AddMacEntitlements.targets" />
+  <Import Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Project="targets\MacEntitlements\AddMacEntitlements.targets" />
   
 </Project>
\ No newline at end of file
diff --git a/src/redist/targets/AddMacEntitlements.targets b/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
similarity index 100%
rename from src/redist/targets/AddMacEntitlements.targets
rename to src/redist/targets/MacEntitlements/AddMacEntitlements.targets
diff --git a/src/redist/entitlements.plist b/src/redist/targets/MacEntitlements/entitlements.plist
similarity index 100%
rename from src/redist/entitlements.plist
rename to src/redist/targets/MacEntitlements/entitlements.plist

From 271497ef7496939e02dd0aed1fefc5256c44d29f Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 13:17:35 -0700
Subject: [PATCH 11/13] Remove run

---
 .vsts-ci.yml | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/.vsts-ci.yml b/.vsts-ci.yml
index 22cf7e48..ec375e8b 100644
--- a/.vsts-ci.yml
+++ b/.vsts-ci.yml
@@ -130,20 +130,16 @@ extends:
               matrix:
                 ARM64:
                   _RID: osx-arm64
-                  _BuildConfig: Release
-                  _SignType: real
                   _DotNetPublishToBlobFeed: false
                 X64:
                   _RID: osx-x64
-                  _BuildConfig: Release
-                  _SignType: real
                   _DotNetPublishToBlobFeed: false
             steps:
             - checkout: self
               clean: true
             - script: eng/common/cibuild.sh
                 --sign
-                --configuration $(_BuildConfig)
+                --configuration Release
                 --prepareMachine
                 -p:RID=$(_RID) -p:DotNetSignType=real -p:TeamName=$(TeamName) -p:OfficialBuildId=$(Build.BuildNumber)
               displayName: Build
@@ -162,6 +158,4 @@ extends:
                 PathtoPublish: '$(Build.ArtifactStagingDirectory)'
                 ArtifactName: 'drop-$(_RID)'
                 publishLocation: 'Container'
-                parallel: true
-            - script: artifacts/layout/dotnet-core-uninstall/dotnet-core-uninstall -h
-              displayName: Run
\ No newline at end of file
+                parallel: true
\ No newline at end of file

From 81e8f328b3097a58e9bd7e9707473d484b1669d3 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 13:21:03 -0700
Subject: [PATCH 12/13] Add comments

---
 src/redist/redist.csproj                                      | 2 ++
 src/redist/targets/MacEntitlements/AddMacEntitlements.targets | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj
index f7cc398c..759ab143 100644
--- a/src/redist/redist.csproj
+++ b/src/redist/redist.csproj
@@ -19,6 +19,8 @@
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\FileExtensions.targets" />
   <Import Condition="'$(RID)' == 'win-x86'" Project="targets\GenerateMSIs.targets" />
   <Target Condition="'$(RID)' == 'win-x86'" Name="GenerateMSIs" AfterTargets="Build" DependsOnTargets="GenerateLayout;GenerateDotnetCoreUninstallMsi" />
+
+  <!-- Entitlements are needed but not automatically added for macOS. See https://github.com/dotnet/runtime/issues/113707 -->
   <Import Condition="'$(RID)' == 'osx-x64' OR '$(RID)' == 'osx-arm64'" Project="targets\MacEntitlements\AddMacEntitlements.targets" />
   
 </Project>
\ No newline at end of file
diff --git a/src/redist/targets/MacEntitlements/AddMacEntitlements.targets b/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
index e6d6a228..95632f8c 100644
--- a/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
+++ b/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
@@ -1,5 +1,6 @@
 <Project>
-    <!-- This is needed as Arcade signing does not add entitlements. This generates an ad-hoc signature with entitlements that would later be replaced by the actual signature. -->
+    <!-- Entitlements are needed but not automatically added for macOS. See https://github.com/dotnet/runtime/issues/113707 -->
+    <!-- This generates an ad-hoc signature that will later be resigned, but keeps the entitlements. -->
     <Target Name="AddEntitlements" AfterTargets="GenerateLayout">
         <Exec Command="codesign -s - -f --entitlements $(MSBuildThisFileDirectory)entitlements.plist $(ArtifactsDir)layout/dotnet-core-uninstall/dotnet-core-uninstall" />
     </Target>

From 3642837131d84c9230b72cf6e2300a80a493f3b2 Mon Sep 17 00:00:00 2001
From: Eduardo Villalpando Mello <eduardov@microsoft.com>
Date: Wed, 19 Mar 2025 13:45:08 -0700
Subject: [PATCH 13/13] Fix target name

---
 src/redist/targets/MacEntitlements/AddMacEntitlements.targets | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/redist/targets/MacEntitlements/AddMacEntitlements.targets b/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
index 95632f8c..cbab9a62 100644
--- a/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
+++ b/src/redist/targets/MacEntitlements/AddMacEntitlements.targets
@@ -1,7 +1,7 @@
 <Project>
     <!-- Entitlements are needed but not automatically added for macOS. See https://github.com/dotnet/runtime/issues/113707 -->
     <!-- This generates an ad-hoc signature that will later be resigned, but keeps the entitlements. -->
-    <Target Name="AddEntitlements" AfterTargets="GenerateLayout">
+    <Target Name="AddMacEntitlements" AfterTargets="GenerateLayout">
         <Exec Command="codesign -s - -f --entitlements $(MSBuildThisFileDirectory)entitlements.plist $(ArtifactsDir)layout/dotnet-core-uninstall/dotnet-core-uninstall" />
     </Target>
 </Project>
\ No newline at end of file
