diff --git a/.github/actions/spell-check/allow/names.txt b/.github/actions/spell-check/allow/names.txt
index fc153dd632..84884b819c 100644
--- a/.github/actions/spell-check/allow/names.txt
+++ b/.github/actions/spell-check/allow/names.txt
@@ -154,6 +154,7 @@ Santossio
Schoen
Sekan
Seraphima
+Shmuelie
skttl
somil
Soref
diff --git a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props
index 4e4102de90..782ec68bf5 100644
--- a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props
+++ b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/Directory.Packages.props
@@ -10,6 +10,7 @@
+
diff --git a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/Program.cs b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/Program.cs
index 7325c7c960..200ac6e71e 100644
--- a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/Program.cs
+++ b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/Program.cs
@@ -2,28 +2,32 @@
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using Microsoft.CommandPalette.Extensions;
+using Shmuelie.WinRTServer;
+using Shmuelie.WinRTServer.CsWinRT;
using System;
using System.Threading;
-using Microsoft.CommandPalette.Extensions;
+using System.Threading.Tasks;
namespace TemplateCmdPalExtension;
public class Program
{
[MTAThread]
- public static void Main(string[] args)
+ public static async Task Main(string[] args)
{
if (args.Length > 0 && args[0] == "-RegisterProcessAsComServer")
{
- using ExtensionServer server = new();
- var extensionDisposedEvent = new ManualResetEvent(false);
- var extensionInstance = new TemplateCmdPalExtension(extensionDisposedEvent);
-
+ await using global::Shmuelie.WinRTServer.ComServer server = new();
+ ManualResetEvent extensionDisposedEvent = new(false);
+
// We are instantiating an extension instance once above, and returning it every time the callback in RegisterExtension below is called.
// This makes sure that only one instance of SampleExtension is alive, which is returned every time the host asks for the IExtension object.
// If you want to instantiate a new instance each time the host asks, create the new instance inside the delegate.
- server.RegisterExtension(() => extensionInstance);
-
+ TemplateCmdPalExtension extensionInstance = new(extensionDisposedEvent);
+ server.RegisterClass(() => extensionInstance);
+ server.Start();
+
// This will make the main thread wait until the event is signalled by the extension class.
// Since we have single instance of the extension object, we exit as soon as it is disposed.
extensionDisposedEvent.WaitOne();
diff --git a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.cs b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.cs
index ac6659e3b4..c05b361b76 100644
--- a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.cs
+++ b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.cs
@@ -9,9 +9,7 @@ using Microsoft.CommandPalette.Extensions;
namespace TemplateCmdPalExtension;
-[ComVisible(true)]
[Guid("FFFFFFFF-FFFF-FFFF-FFFF-FFFFFFFFFFFF")]
-[ComDefaultInterface(typeof(IExtension))]
public sealed partial class TemplateCmdPalExtension : IExtension, IDisposable
{
private readonly ManualResetEvent _extensionDisposedEvent;
diff --git a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.csproj b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.csproj
index 6b58eb0e05..72e6d7400b 100644
--- a/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.csproj
+++ b/src/modules/cmdpal/ExtensionTemplate/TemplateCmdPalExtension/TemplateCmdPalExtension/TemplateCmdPalExtension.csproj
@@ -43,6 +43,7 @@
+