# Microsoft.Threading.Tasks.Extensions.Desktop

**Kind:** Service

**Source:** `Pams/Logic/Pams.Storage/Pams.Storage.csproj` (line 1)

**Part of:** [Pams](subsystem-pams)

NuGet package dependency

`Microsoft.Threading.Tasks.Extensions.Desktop` is a NuGet dependency declared by `Pams.Storage` for task-related APIs used by desktop-targeted .NET code. It supports asynchronous storage operations where the project needs compatible task and value-task types across its target framework dependencies.

## Diagram

```mermaid
sequenceDiagram
    participant Storage as Pams.Storage
    participant Package as Microsoft.Threading.Tasks.Extensions.Desktop
    participant Runtime as .NET Runtime

    Storage->>Package: Reference task extension APIs
    Package->>Runtime: Bind compatible async types
    Runtime-->>Storage: Complete asynchronous operation
```

## Usage

```ts
import { execFileSync } from "node:child_process";
import { resolve } from "node:path";

const storageProject = resolve("Pams/Logic/Pams.Storage");

execFileSync("dotnet", ["restore"], {
  cwd: storageProject,
  stdio: "inherit",
});
```

## AI Coding Instructions

- Keep `Microsoft.Threading.Tasks.Extensions.Desktop` declared through the project’s existing NuGet dependency format.
- Restore the `Pams.Storage` project after changing package references or target framework settings.
- Check target framework compatibility before replacing this dependency with task APIs from the base runtime.
- Avoid adding application code that depends directly on package internals; consume async abstractions through the storage project’s public APIs.

## Used by

2 references from 2 files. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.

### Injected or called by (2)

- `Pams.Email` — `Pams/Logic/Pams.Email/Pams.Email.csproj`:1
- `Pams.Storage` — `Pams/Logic/Pams.Storage/Pams.Storage.csproj`:1
