Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
3195996
Tsg update/20260316 9a6e84d2 (#7)
qiutongMS Mar 16, 2026
ee20b68
update tsg for recent issues
Mar 17, 2026
3270058
remove index
Mar 20, 2026
8ee04d8
Add 2 new TSGs, update 1 existing TSG - incremental 2026-03-20
Mar 20, 2026
dee1279
Pipeline incremental: update 2 TSGs (issues #6197, #4791)
qiutongMS Mar 23, 2026
10c9c01
Merge branch 'microsoft:main' into main
qiutongMS Mar 24, 2026
bc7bc3a
Pipeline 20260330_040001: 5 actionable, 3 known issues
qiutongMS Mar 30, 2026
c0646ef
Pipeline 20260406_040001: 5 actionable, 5 known issues
qiutongMS Apr 6, 2026
b5afc75
Pipeline 20260420_040002: 9 actionable, 9 known issues
qiutongMS Apr 20, 2026
f082365
Pipeline 20260427_040002: 9 actionable, 9 known issues
qiutongMS Apr 27, 2026
57dc2e1
Pipeline 20260504_040003: 13 actionable, 10 known issues
qiutongMS May 4, 2026
ad72211
Pipeline 20260511_040001: 15 actionable, 16 known issues
qiutongMS May 11, 2026
bc9ba12
Pipeline 20260518_040002: 18 actionable, 18 known issues
qiutongMS May 18, 2026
92c7299
Pipeline 20260525_040002: 18 actionable, 18 known issues
qiutongMS May 25, 2026
355792c
Pipeline 20260601_040005: 18 actionable, 20 known issues
qiutongMS Jun 1, 2026
00ba2aa
Pipeline 20260608_040002: 18 actionable, 21 known issues
qiutongMS Jun 8, 2026
39a972b
Pipeline 20260615_040002: 20 actionable, 21 known issues
qiutongMS Jun 15, 2026
e6cabfd
Pipeline 20260622_040002: 22 actionable, 23 known issues
qiutongMS Jun 22, 2026
bfce16c
Pipeline 20260629_040001: 22 actionable, 24 known issues
qiutongMS Jun 29, 2026
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
116 changes: 116 additions & 0 deletions trouble-shooting-notes/tsg_activation_and_rpc_errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Error: "The RPC server is unavailable" (System.Runtime.InteropServices.COMException) - AppInstance.GetActivatedEventArgs()

**Keywords:** RPC server is unavailable, System.Runtime.InteropServices.COMException, AppInstance.GetActivatedEventArgs, activation arguments, WinUI3, Windows.ApplicationModel.AppInstance

**Error Example:**
```
System.Runtime.InteropServices.COMException: 'The RPC server is unavailable.'
```

---

## Quick Match

**You're seeing this if:**
- Error contains "The RPC server is unavailable"
- Calling `AppInstance.GetCurrent().GetActivatedEventArgs()` in a WinUI3 app
- Platform: Windows, Packaged (MSIX)

→ Check scenarios below for your specific cause

---

## Related Issues

- [#5481](https://github.com/microsoft/WindowsAppSDK/issues/5481) - Exception triggered when calling `AppInstance.GetCurrent().GetActivatedEventArgs()` (Status: Closed)

---

## Scenarios & Solutions

### Scenario 1: Activation arguments lifetime tied to the calling process

**Cause:** The activation arguments object is created in the calling process and is only available while that process is running. If the calling process terminates too quickly, the activation arguments become unavailable.
> Source: @florelis [MSFT] in [#5481](https://github.com/microsoft/WindowsAppSDK/issues/5481)

**Fix:**
1. Add a delay to extend the lifetime of the calling process.
2. For example, in the console application, add a `Thread.Sleep()` after `Process.Start()` to keep the process alive longer.

> ✅ Confirmed by: @florelis [MSFT] in issue comments

**Verify:** Add a `Thread.Sleep()` in the console application and observe if the error no longer occurs.

---

### Scenario 2: Use Win32 APIs to retrieve activation parameters

**Cause:** The `AppInstance.GetCurrent().GetActivatedEventArgs()` method may not work reliably in certain scenarios, such as when called from a non-UWP packaged app.
> Source: @lgBlog in [#5481](https://github.com/microsoft/WindowsAppSDK/issues/5481)

**Fix:**
1. Use the following Win32 APIs to retrieve activation parameters directly:
- `GetCommandLineW`
- `CommandLineToArgvW`
- `LocalFree`
2. Example implementation:
```csharp
[DllImport("kernel32.dll", CharSet = CharSet.Unicode)]
private static extern IntPtr GetCommandLineW();

[DllImport("shell32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern IntPtr CommandLineToArgvW([MarshalAs(UnmanagedType.LPWStr)] string lpCmdLine, out int pNumArgs);

[DllImport("kernel32.dll")]
private static extern IntPtr LocalFree(IntPtr hMem);

private List<string> Win32GetActivationFiles()
{
var files = new List<string>(4);

IntPtr ptr = GetCommandLineW();
string cmdLine = Marshal.PtrToStringUni(ptr) ?? string.Empty;

if (string.IsNullOrEmpty(cmdLine))
return files;

IntPtr argv = CommandLineToArgvW(cmdLine, out int argc);
if (argv == IntPtr.Zero)
return files;

try
{
for (int i = 0; i < argc; i++)
{
string arg = Marshal.PtrToStringUni(Marshal.ReadIntPtr(argv, i * IntPtr.Size)) ?? string.Empty;
files.Add(arg);
}
}
finally
{
LocalFree(argv);
}

return files;
}
```

---

## ⚠️ Unverified / Community Suggestions

> The following are community suggestions that have NOT been officially confirmed.

- None provided.

---

## References

- [Issue #5481](https://github.com/microsoft/WindowsAppSDK/issues/5481)
- [AppInstance.GetActivatedEventArgs() documentation](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/api/winrt/microsoft.windows.applicationsmodel.appinstance.getactivatedeventargs)

---

**Updated:** 2026-03-17 | **Confidence:** 0.9
**Sources:** [#5481](https://github.com/microsoft/WindowsAppSDK/issues/5481)
111 changes: 111 additions & 0 deletions trouble-shooting-notes/tsg_ai_dll_transitive_dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Error: "Unexpected AI-related DLLs are bundled in my app" - Microsoft.WindowsAppSDK

**Keywords:** AI-related DLLs, Microsoft.WindowsAppSDK, transitive dependencies, onnxruntime.dll, DirectML.dll, Microsoft.Windows.AI.MachineLearning.dll, WindowsAppSDKSelfContained

**Error Example:**
```
onnxruntime.dll 21MB
DirectML.dll 18MB
Microsoft.Windows.AI.MachineLearning.dll 870kb
```

---

## Quick Match

**You're seeing this if:**
- Your app includes unexpected AI-related DLLs such as `onnxruntime.dll`, `DirectML.dll`, or `Microsoft.Windows.AI.MachineLearning.dll`
- You are referencing the `Microsoft.WindowsAppSDK` NuGet package
- Platform: Windows

→ Check scenarios below for your specific cause

---

## Related Issues

- [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464) - Unexpected AI-related DLLs are bundled into my app (Status: Closed)

---

## Scenarios & Solutions

### Scenario 1: Transitive dependencies from `Microsoft.WindowsAppSDK`

**Cause:** Referencing the `Microsoft.WindowsAppSDK` metapackage pulls in transitive dependencies, including AI-related DLLs. These dependencies are part of the package and are included by default.
> Source: @ssparach in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Fix:**
1. Instead of referencing the `Microsoft.WindowsAppSDK` metapackage, reference only the specific component packages your app depends on. For example:
```xml
<PackageReference Include="Microsoft.WindowsAppSDK.Base" Version="2.0.3" />
```
2. If you need additional functionality, add the required component packages individually.

> ✅ Confirmed by: @lgztx96 in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Verify:** Check your app's output directory to ensure the AI-related DLLs (`onnxruntime.dll`, `DirectML.dll`, `Microsoft.Windows.AI.MachineLearning.dll`) are no longer included.

---

### Scenario 2: Using `WindowsAppSDKSelfContained` property

**Cause:** The `WindowsAppSDKSelfContained` property determines whether the Windows App SDK is packaged as a self-contained deployment or as a framework-dependent deployment. Setting this property to `true` excludes the AI-related DLLs.
> Source: @catmanjan in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Fix:**
1. Add the following property to your project file:
```xml
<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
```
2. Build your project again. This will exclude the AI-related DLLs from your app.

> ✅ Confirmed by: @catmanjan in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Verify:** Check your app's output directory to ensure the AI-related DLLs (`onnxruntime.dll`, `DirectML.dll`, `Microsoft.Windows.AI.MachineLearning.dll`) are no longer included.

---

### Scenario 3: Using `Microsoft.WindowsAppSDK.Runtime` instead of `Microsoft.WindowsAppSDK`

**Cause:** The `Microsoft.WindowsAppSDK` metapackage includes all dependent packages, including AI-related ones. Using `Microsoft.WindowsAppSDK.Runtime` as a standalone package avoids pulling in unnecessary dependencies.
> Source: @lgztx96 in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Fix:**
1. Remove the `Microsoft.WindowsAppSDK` package reference from your project file.
2. Add a reference to `Microsoft.WindowsAppSDK.Runtime` and any other specific component packages you need. For example:
```xml
<PackageReference Include="Microsoft.WindowsAppSDK.Runtime" Version="2.0.3" />
<PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="2.0.3" />
```

> ✅ Confirmed by: @lgztx96 in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

**Verify:** Check your app's output directory to ensure the AI-related DLLs (`onnxruntime.dll`, `DirectML.dll`, `Microsoft.Windows.AI.MachineLearning.dll`) are no longer included.

---

## ⚠️ Unverified / Community Suggestions

> The following are community suggestions that have NOT been officially confirmed.

- Use `<ExcludeAssets>` to exclude specific assets from the `Microsoft.WindowsAppSDK` package:
```xml
<PackageReference Include="Microsoft.WindowsAppSDK" Version="2.0.1">
<ExcludeAssets>native</ExcludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.WindowsAppSDK.Base" Version="2.0.3" />
```
> Source: @catmanjan in [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

---

## References

- [Official docs](https://learn.microsoft.com/en-us/windows/apps/package-and-deploy/deploy-overview)
- [Issue #6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)

---

**Updated:** 2026-06-29 | **Confidence:** 0.9
**Sources:** [#6464](https://github.com/microsoft/WindowsAppSDK/issues/6464)
Loading