diff --git a/.github/workflows/dependabot-approve-and-automerge.yml b/.github/workflows/dependabot-approve-and-automerge.yml
index 04daa3d5e1d..8ad436085e9 100644
--- a/.github/workflows/dependabot-approve-and-automerge.yml
+++ b/.github/workflows/dependabot-approve-and-automerge.yml
@@ -8,7 +8,7 @@ permissions:
jobs:
dependabot:
runs-on: ubuntu-latest
- if: ${{ github.actor == 'dependabot[bot]' }}
+ if: ${{ github.actor == 'dependabot[bot]' && github.repository_owner == 'dotnet' }}
steps:
- name: Dependabot metadata
id: metadata
diff --git a/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj b/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj
index fad9b14c78c..d75fd3b5541 100644
--- a/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj
+++ b/azure/sdk-identity-resources-storage/AzureIdentityStorageExample.csproj
@@ -20,10 +20,10 @@
-
-
-
-
+
+
+
+
diff --git a/core/assembly/MetadataLoadContext/MetadataLoadContextSample.csproj b/core/assembly/MetadataLoadContext/MetadataLoadContextSample.csproj
index 8e88a3e2560..9c421dab617 100644
--- a/core/assembly/MetadataLoadContext/MetadataLoadContextSample.csproj
+++ b/core/assembly/MetadataLoadContext/MetadataLoadContextSample.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/core/console-apps/NewTypesMsBuild/test/NewTypesTests/NewTypesTests.csproj b/core/console-apps/NewTypesMsBuild/test/NewTypesTests/NewTypesTests.csproj
index de4270a1161..0cb7fd1a1e8 100644
--- a/core/console-apps/NewTypesMsBuild/test/NewTypesTests/NewTypesTests.csproj
+++ b/core/console-apps/NewTypesMsBuild/test/NewTypesTests/NewTypesTests.csproj
@@ -5,9 +5,9 @@
-
-
-
+
+
+
diff --git a/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj b/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj
index bb4e2bda1da..2c6b28e1be1 100644
--- a/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj
+++ b/core/diagnostics/DiagnosticScenarios/DiagnosticScenarios.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/core/encoding/cyrillic-to-latin/cs/CyrillicToLatin.csproj b/core/encoding/cyrillic-to-latin/cs/CyrillicToLatin.csproj
index e12b5ecb9ae..a4fb324cffe 100644
--- a/core/encoding/cyrillic-to-latin/cs/CyrillicToLatin.csproj
+++ b/core/encoding/cyrillic-to-latin/cs/CyrillicToLatin.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/core/getting-started/golden/test-library/test-library.csproj b/core/getting-started/golden/test-library/test-library.csproj
index 199c8497bed..4c3ed0cc444 100644
--- a/core/getting-started/golden/test-library/test-library.csproj
+++ b/core/getting-started/golden/test-library/test-library.csproj
@@ -6,9 +6,9 @@
-
-
-
+
+
+
diff --git a/core/getting-started/golden/test/test-library/test-library.csproj b/core/getting-started/golden/test/test-library/test-library.csproj
index 6a63886a071..05519635c03 100644
--- a/core/getting-started/golden/test/test-library/test-library.csproj
+++ b/core/getting-started/golden/test/test-library/test-library.csproj
@@ -9,9 +9,9 @@
-
-
-
+
+
+
diff --git a/core/getting-started/unit-testing-using-dotnet-test/PrimeService.Tests/PrimeService.Tests.csproj b/core/getting-started/unit-testing-using-dotnet-test/PrimeService.Tests/PrimeService.Tests.csproj
index 2324dcff0f2..48e2d771358 100644
--- a/core/getting-started/unit-testing-using-dotnet-test/PrimeService.Tests/PrimeService.Tests.csproj
+++ b/core/getting-started/unit-testing-using-dotnet-test/PrimeService.Tests/PrimeService.Tests.csproj
@@ -6,9 +6,9 @@
-
-
-
+
+
+
diff --git a/core/getting-started/unit-testing-using-mstest/PrimeService.Tests/PrimeService.Tests.csproj b/core/getting-started/unit-testing-using-mstest/PrimeService.Tests/PrimeService.Tests.csproj
index b2860c2b953..3a8bdb94972 100644
--- a/core/getting-started/unit-testing-using-mstest/PrimeService.Tests/PrimeService.Tests.csproj
+++ b/core/getting-started/unit-testing-using-mstest/PrimeService.Tests/PrimeService.Tests.csproj
@@ -5,7 +5,7 @@
-
+
diff --git a/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj b/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj
index 98f0cacb989..b6031482f24 100644
--- a/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj
+++ b/core/getting-started/unit-testing-using-nunit/PrimeService.Tests/PrimeService.Tests.csproj
@@ -8,9 +8,9 @@
-
+
-
+
diff --git a/core/getting-started/unit-testing-vb-dotnet-test/PrimeService.Tests/PrimeService.Tests.vbproj b/core/getting-started/unit-testing-vb-dotnet-test/PrimeService.Tests/PrimeService.Tests.vbproj
index 8793ca0c676..56725adcb7e 100644
--- a/core/getting-started/unit-testing-vb-dotnet-test/PrimeService.Tests/PrimeService.Tests.vbproj
+++ b/core/getting-started/unit-testing-vb-dotnet-test/PrimeService.Tests/PrimeService.Tests.vbproj
@@ -7,9 +7,9 @@
-
-
-
+
+
+
diff --git a/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj b/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj
index b11fc7618df..d3129446921 100644
--- a/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj
+++ b/core/getting-started/unit-testing-vb-mstest/PrimeService.Tests/PrimeService.Tests.vbproj
@@ -7,7 +7,7 @@
-
+
diff --git a/core/getting-started/unit-testing-vb-nunit/PrimeService.Tests/PrimeService.Tests.vbproj b/core/getting-started/unit-testing-vb-nunit/PrimeService.Tests/PrimeService.Tests.vbproj
index a02fcbac93d..63b1ce53df9 100644
--- a/core/getting-started/unit-testing-vb-nunit/PrimeService.Tests/PrimeService.Tests.vbproj
+++ b/core/getting-started/unit-testing-vb-nunit/PrimeService.Tests/PrimeService.Tests.vbproj
@@ -8,9 +8,9 @@
-
+
-
+
diff --git a/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj b/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj
index 40555f9eb85..c6856cd4b16 100644
--- a/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj
+++ b/core/getting-started/unit-testing-with-fsharp-mstest/MathService.Tests/MathService.Tests.fsproj
@@ -12,7 +12,7 @@
-
+
diff --git a/core/getting-started/unit-testing-with-fsharp-nunit/MathService.Tests/MathService.Tests.fsproj b/core/getting-started/unit-testing-with-fsharp-nunit/MathService.Tests/MathService.Tests.fsproj
index b6a1bd9a5a1..3a49a114f59 100644
--- a/core/getting-started/unit-testing-with-fsharp-nunit/MathService.Tests/MathService.Tests.fsproj
+++ b/core/getting-started/unit-testing-with-fsharp-nunit/MathService.Tests/MathService.Tests.fsproj
@@ -13,9 +13,9 @@
-
+
-
+
diff --git a/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj b/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj
index c9f8c71fc6f..3f340e1bdb6 100644
--- a/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj
+++ b/core/getting-started/unit-testing-with-fsharp/MathService.Tests/MathService.Tests.fsproj
@@ -12,9 +12,9 @@
-
-
-
+
+
+
diff --git a/core/interop/source-generation/ComWrappersGeneration/.gitignore b/core/interop/source-generation/ComWrappersGeneration/.gitignore
new file mode 100644
index 00000000000..3195f839657
--- /dev/null
+++ b/core/interop/source-generation/ComWrappersGeneration/.gitignore
@@ -0,0 +1 @@
+OutputFiles
diff --git a/core/interop/source-generation/ComWrappersGeneration/Client/Client.csproj b/core/interop/source-generation/ComWrappersGeneration/Client/Client.csproj
new file mode 100644
index 00000000000..f35c6e9ddde
--- /dev/null
+++ b/core/interop/source-generation/ComWrappersGeneration/Client/Client.csproj
@@ -0,0 +1,13 @@
+
+
+
+ Exe
+ net8.0
+ enable
+ enable
+
+
+
+
+
+
diff --git a/core/interop/source-generation/ComWrappersGeneration/Client/Program.cs b/core/interop/source-generation/ComWrappersGeneration/Client/Program.cs
new file mode 100644
index 00000000000..11fcf8a6b72
--- /dev/null
+++ b/core/interop/source-generation/ComWrappersGeneration/Client/Program.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Diagnostics;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Runtime.InteropServices.Marshalling;
+
+[assembly: DisableRuntimeMarshalling]
+
+namespace Tutorial;
+
+public class Program
+{
+ public static unsafe void Main(string[] args)
+ {
+ var clsid = new Guid(Clsids.Calculator);
+ var iid = new Guid(ICalculator.IID);
+ Console.WriteLine($"Client: Requesting a Calculator (CLSID {clsid}) with ICalculator (IID {iid})");
+ int hr = Ole32.CoCreateInstance(ref clsid, /* No aggregation */ 0, (uint)Ole32.CLSCTX.CLSCTX_INPROC_SERVER, ref iid, out object comObject);
+ Marshal.ThrowExceptionForHR(hr);
+ ICalculator calculator = (ICalculator) comObject;
+
+ int a = 5;
+ int b = 3;
+ int c;
+ c = calculator.Add(a, b);
+ Console.WriteLine($"Client: {a} + {b} = {c}");
+ c = calculator.Subtract(a, b);
+ Console.WriteLine($"Client: {a} - {b} = {c}");
+ }
+}
+
+internal static unsafe partial class Ole32
+{
+ // https://docs.microsoft.com/windows/win32/api/combaseapi/nf-combaseapi-cocreateinstance
+ [LibraryImport(nameof(Ole32))]
+ public static partial int CoCreateInstance(
+ ref Guid rclsid,
+ nint pUnkOuter,
+ uint dwClsContext,
+ ref Guid riid,
+ // The default ComInterfaceMarshaller will unwrap a .NET object if it can tell the COM instance is a ComWrapper.
+ // This causes issues when casting to ICalculator, since the Server's Calculator class doesn't implement the Client's interface.
+ // UniqueComInterfaceMarshaller doesn't try to unwrap the object and always creates a new COM object.
+ [MarshalUsing(typeof(UniqueComInterfaceMarshaller