@cratis/pi 7.182.0 → 7.183.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package/corpus/harnesses/copilot/instructions/csharp.instructions.md +20 -0
- package/package/corpus/rules/csharp.md +20 -0
- package/package/corpus/skills/exp-mock-usage-analysis/LICENSE +23 -0
- package/package/corpus/skills/exp-mock-usage-analysis/NOTICE +21 -0
- package/package/corpus/skills/exp-mock-usage-analysis/SKILL.md +87 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/LICENSE +23 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/NOTICE +30 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/SKILL.md +97 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/aspnetcore-dotnet10to11.md +24 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/core-libraries-dotnet10to11.md +124 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/cryptography-dotnet10to11.md +38 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/csharp-compiler-dotnet10to11.md +165 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/efcore-dotnet10to11.md +94 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/runtime-jit-dotnet10to11.md +58 -0
- package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/sdk-msbuild-dotnet10to11.md +26 -0
- package/package/corpus/skills/pvanalyze/LICENSE +21 -0
- package/package/corpus/skills/pvanalyze/NOTICE +32 -0
- package/package/corpus/skills/pvanalyze/SKILL.md +54 -0
- package/package/corpus/skills/pvanalyze/assets/NuGet.Config +7 -0
- package/package/corpus/skills/pvanalyze/assets/dotnet-tools.json +13 -0
- package/package/corpus/skills/pvanalyze/references/commands.md +147 -0
- package/package/corpus/skills/pvanalyze/references/install.md +50 -0
- package/package/corpus/skills/pvanalyze/references/overview.md +41 -0
- package/package/profile-catalog.json +15 -2
- package/package.json +1 -1
|
@@ -333,6 +333,26 @@ public class ReactorSideEffectHandlers(IInstancesOf<IReactorSideEffectHandler> h
|
|
|
333
333
|
- Keep log messages in a separate `<ClassName>Logging.cs` partial static internal class.
|
|
334
334
|
- Use `[LoggerMessage]` attribute (without `eventId`).
|
|
335
335
|
|
|
336
|
+
## C# 14/15 Language Features
|
|
337
|
+
|
|
338
|
+
Cratis .NET repos build with SDK 11 (C# 15); libraries target `net10.0;net11.0`.
|
|
339
|
+
|
|
340
|
+
Use in new code:
|
|
341
|
+
|
|
342
|
+
- Extension blocks (`extension(T x) { ... }`, C# 14) for new extension APIs; leave existing extension classes as they are.
|
|
343
|
+
- The `field` keyword (C# 14) in property accessors instead of a hand-written backing field.
|
|
344
|
+
- `System.Threading.Lock` for new lock objects instead of `object`.
|
|
345
|
+
- Collection expression arguments `with(...)` (C# 15), e.g. to pass a comparer or capacity.
|
|
346
|
+
- `closed` (C# 15) for new internal class hierarchies.
|
|
347
|
+
|
|
348
|
+
Avoid:
|
|
349
|
+
|
|
350
|
+
- Union types in public APIs of libraries that also target `net10.0` — consumers on C# 14 cannot use them.
|
|
351
|
+
- Adding `closed` to existing public types — it is a breaking change.
|
|
352
|
+
- Runtime-async — it is still preview.
|
|
353
|
+
|
|
354
|
+
Keep `ConceptAs<T>` and the existing result envelopes unchanged.
|
|
355
|
+
|
|
336
356
|
## Async
|
|
337
357
|
|
|
338
358
|
- Use `async`/`await` for asynchronous programming.
|
|
@@ -332,6 +332,26 @@ public class ReactorSideEffectHandlers(IInstancesOf<IReactorSideEffectHandler> h
|
|
|
332
332
|
- Keep log messages in a separate `<ClassName>Logging.cs` partial static internal class.
|
|
333
333
|
- Use `[LoggerMessage]` attribute (without `eventId`).
|
|
334
334
|
|
|
335
|
+
## C# 14/15 Language Features
|
|
336
|
+
|
|
337
|
+
Cratis .NET repos build with SDK 11 (C# 15); libraries target `net10.0;net11.0`.
|
|
338
|
+
|
|
339
|
+
Use in new code:
|
|
340
|
+
|
|
341
|
+
- Extension blocks (`extension(T x) { ... }`, C# 14) for new extension APIs; leave existing extension classes as they are.
|
|
342
|
+
- The `field` keyword (C# 14) in property accessors instead of a hand-written backing field.
|
|
343
|
+
- `System.Threading.Lock` for new lock objects instead of `object`.
|
|
344
|
+
- Collection expression arguments `with(...)` (C# 15), e.g. to pass a comparer or capacity.
|
|
345
|
+
- `closed` (C# 15) for new internal class hierarchies.
|
|
346
|
+
|
|
347
|
+
Avoid:
|
|
348
|
+
|
|
349
|
+
- Union types in public APIs of libraries that also target `net10.0` — consumers on C# 14 cannot use them.
|
|
350
|
+
- Adding `closed` to existing public types — it is a breaking change.
|
|
351
|
+
- Runtime-async — it is still preview.
|
|
352
|
+
|
|
353
|
+
Keep `ConceptAs<T>` and the existing result envelopes unchanged.
|
|
354
|
+
|
|
335
355
|
## Async
|
|
336
356
|
|
|
337
357
|
- Use `async`/`await` for asynchronous programming.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) .NET Foundation and Contributors
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Mock Usage Analysis
|
|
2
|
+
Copyright (c) .NET Foundation and Contributors
|
|
3
|
+
Licensed under the MIT License. See LICENSE.
|
|
4
|
+
|
|
5
|
+
Upstream source: https://github.com/dotnet/skills/blob/c227688ed14de4467e3e45f95dc69a94e905e219/plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md
|
|
6
|
+
|
|
7
|
+
Changes made by Cratis:
|
|
8
|
+
|
|
9
|
+
LICENSE:
|
|
10
|
+
- Copy upstream MIT license and copyright verbatim.
|
|
11
|
+
|
|
12
|
+
SKILL.md:
|
|
13
|
+
- Rewrite the description to the Cratis routing shape; scope the skill to NSubstitute in Cratis.Specifications contexts and drop the Moq and FakeItEasy terminology.
|
|
14
|
+
- Replace the per-test-method analysis with the full Specification context chain: inherited Establish, concrete Because and should_ assertions.
|
|
15
|
+
- Treat Received and DidNotReceive as assertions, not stubbing, and accept side-effect-only specifications at external boundaries.
|
|
16
|
+
- Replace the duplicated-setup and fixture refactoring advice with scenario-local shared contexts; remove the advice to replace collaborators with real implementations except for framework types such as loggers and options.
|
|
17
|
+
- Add an NSubstitute example, a static-hypothesis caveat and a no-edit-without-request rule.
|
|
18
|
+
- Replace the reference to an absent sibling skill with cratis-specifications-csharp.
|
|
19
|
+
- Add the marked modification/source comment and Cratis precedence line.
|
|
20
|
+
|
|
21
|
+
Executes or downloads: none.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: exp-mock-usage-analysis
|
|
3
|
+
description: Use when auditing existing NSubstitute setups in C# specifications for unused, unreachable or over-configured substitutes. Not for writing new specifications, replacing a mocking library or measuring coverage.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- Modified by Cratis from dotnet's original (MIT): frontmatter, applicability, Specification lifecycle, NSubstitute scope and the changes listed in NOTICE. Upstream: https://github.com/dotnet/skills (plugins/dotnet-experimental/skills/exp-mock-usage-analysis/SKILL.md; see NOTICE) -->
|
|
8
|
+
|
|
9
|
+
# Mock usage analysis
|
|
10
|
+
|
|
11
|
+
Cratis rules in `.cratis/ai/rules/` (including `specs.csharp.md`) and the `cratis-*` skills win where they differ. Use [cratis-specifications-csharp](../cratis-specifications-csharp/SKILL.md) for writing or restructuring specifications; this skill only audits setups that already exist.
|
|
12
|
+
|
|
13
|
+
Trace each NSubstitute setup through the production code's execution path to find setups that no scenario exercises. A review request is not authority to edit or run anything: report findings, and edit only when asked.
|
|
14
|
+
|
|
15
|
+
## Inputs
|
|
16
|
+
|
|
17
|
+
| Input | Required | Description |
|
|
18
|
+
|-------|----------|-------------|
|
|
19
|
+
| Specification files | Yes | The contexts to audit, including every base context in the inheritance chain |
|
|
20
|
+
| Production code | Yes | The code under test; control flow cannot be traced without it |
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
### Step 1: Read the whole scenario
|
|
25
|
+
|
|
26
|
+
Read the concrete specification, every base context it inherits from (for example `given/all_dependencies.cs`) and the production code. A scenario is the context chain run base-first:
|
|
27
|
+
|
|
28
|
+
1. Each class's `Establish()` from the base context down.
|
|
29
|
+
2. The concrete class's single `Because()`.
|
|
30
|
+
3. Every `should_*` fact, which all share that one run.
|
|
31
|
+
|
|
32
|
+
### Step 2: Trace each setup per scenario
|
|
33
|
+
|
|
34
|
+
Identify every `Substitute.For<T>()`, `.Returns(...)`, `.Throws(...)` and `Arg` matcher. Follow the production method for the inputs `Because()` supplies and classify each setup:
|
|
35
|
+
|
|
36
|
+
| Classification | Meaning |
|
|
37
|
+
|----------------|---------|
|
|
38
|
+
| **Used** | `Because()` reaches the call, or an assertion reads the result |
|
|
39
|
+
| **Unreachable** | A guard, early return or throw leaves the method before the call in this scenario |
|
|
40
|
+
| **Unused** | The method under test never calls it for any input |
|
|
41
|
+
| **Duplicated** | The same setup repeats across scenarios; not a defect on its own |
|
|
42
|
+
|
|
43
|
+
Rules that prevent false findings:
|
|
44
|
+
|
|
45
|
+
- A setup in an inherited `Establish()` is used when any scenario that inherits it uses it. Unused by one `should_*` fact is not unused by the scenario, because every fact shares the setup that `Because()` runs through.
|
|
46
|
+
- Judge a setup against the scenarios that inherit it. A shared base context may be correct for most derived specs and unnecessary for one; report that distinction.
|
|
47
|
+
- `.Received()` and `.DidNotReceive()` are assertions, not stubbing. A specification that only asserts an interaction at an external boundary, such as a publisher, repository write or HTTP client, is valid even without a return-value assertion.
|
|
48
|
+
- Duplicated setup is not automatically redundant. Propose extraction only into a scenario-local shared base context that every duplicating scenario uses, never a global mutable fixture or an order-dependent setup.
|
|
49
|
+
- Look for early returns, guard clauses, exceptions thrown before a dependency is touched, and branches that dispatch to a different collaborator.
|
|
50
|
+
|
|
51
|
+
### Step 3: Check replaceable substitutes
|
|
52
|
+
|
|
53
|
+
- A substituted `ILogger<T>` can be `NullLogger<T>.Instance` unless the specification asserts log output.
|
|
54
|
+
- A substituted `IOptions<T>` can be `Options.Create(new T { ... })`.
|
|
55
|
+
- A substitute for a plain record or value object can be a real instance.
|
|
56
|
+
|
|
57
|
+
Keep substitutes at external boundaries (databases, HTTP clients, message queues, third-party APIs) and security-sensitive collaborators. Do not recommend replacing collaborators with concrete services in general.
|
|
58
|
+
|
|
59
|
+
### Step 4: Report
|
|
60
|
+
|
|
61
|
+
For each finding, give the specification and setup line, the scenario that makes it unnecessary and the production path that proves it, and the smallest removal or scenario-local change. Name correctly placed boundary substitutes explicitly. Mark every finding a static hypothesis unless the selected specifications were actually run.
|
|
62
|
+
|
|
63
|
+
```csharp
|
|
64
|
+
// given/an_order_handler.cs: Establish is shared by all derived scenarios
|
|
65
|
+
void Establish() => _prices.GetPrice(Arg.Any<string>()).Returns(10m);
|
|
66
|
+
// when_handling_unknown_customer: Because returns at the customer guard before _prices is called,
|
|
67
|
+
// so this scenario never uses the stub. Sibling scenarios do; keep the base setup and report
|
|
68
|
+
// the one scenario that could stop inheriting it.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Validation
|
|
72
|
+
|
|
73
|
+
- [ ] The full context chain and the production code were read and traced.
|
|
74
|
+
- [ ] Each finding names a specific scenario and setup line and the path that proves it.
|
|
75
|
+
- [ ] No setup was flagged only because one assertion does not read it.
|
|
76
|
+
- [ ] `Received`/`DidNotReceive` usage and boundary substitutes were treated as valid.
|
|
77
|
+
- [ ] Findings are labeled static hypotheses unless specifications were run.
|
|
78
|
+
|
|
79
|
+
## Pitfalls
|
|
80
|
+
|
|
81
|
+
| Pitfall | Correction |
|
|
82
|
+
|---------|------------|
|
|
83
|
+
| Reading only the concrete spec file | Read inherited `Establish` contexts too |
|
|
84
|
+
| Flagging a base setup because one fact ignores it | Judge it by the whole scenario |
|
|
85
|
+
| Treating verify-only specifications as dead | `Received` at a boundary is a valid assertion |
|
|
86
|
+
| Deleting duplicated setup across scenarios | Extract only scenario-local shared contexts |
|
|
87
|
+
| Editing while reviewing | Report findings; edit only when asked |
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) .NET Foundation and Contributors
|
|
4
|
+
|
|
5
|
+
All rights reserved.
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.NET 10 to .NET 11 Migration
|
|
2
|
+
Copyright (c) .NET Foundation and Contributors
|
|
3
|
+
Licensed under the MIT License. See LICENSE.
|
|
4
|
+
|
|
5
|
+
Upstream source: https://github.com/dotnet/skills/blob/c227688ed14de4467e3e45f95dc69a94e905e219/plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md
|
|
6
|
+
The references/ files come from the same directory at the same revision.
|
|
7
|
+
|
|
8
|
+
Changes made by Cratis:
|
|
9
|
+
|
|
10
|
+
LICENSE:
|
|
11
|
+
- Copy upstream MIT license and copyright verbatim.
|
|
12
|
+
|
|
13
|
+
SKILL.md:
|
|
14
|
+
- Rewrite the description to the Cratis routing shape.
|
|
15
|
+
- Replace the claim to resolve all breaking changes with a checklist role: confirm each change against the linked Microsoft compatibility page and report contradictions.
|
|
16
|
+
- Replace the ban on external documentation, the automatic commit per step, bin/obj deletion and the blanket upgrade of Microsoft packages to 11.x with the repository's approved SDK, package pins and CI gates.
|
|
17
|
+
- Distinguish the SDK and compiler version from the runtime target and keep net10.0 in multi-targeted libraries; defer C# feature adoption to csharp.md.
|
|
18
|
+
- Replace the preview-era SDK version example and Docker tag edits with approved-scope guidance.
|
|
19
|
+
- Move the per-change lists into the references and add conditional read pointers for every reference.
|
|
20
|
+
- Add the marked modification/source comment and Cratis precedence line.
|
|
21
|
+
|
|
22
|
+
references/*.md:
|
|
23
|
+
- Replace the preview-status note with a statement that the checklist is not the exhaustive release contract.
|
|
24
|
+
- Remove Preview N markers from headings and the Preview 3 section title.
|
|
25
|
+
- Remove GitHub pull request and issue links; keep Microsoft Learn links.
|
|
26
|
+
- csharp-compiler-dotnet10to11.md: point feature adoption to csharp.md.
|
|
27
|
+
- core-libraries-dotnet10to11.md: correct the BackgroundService entry (the host already stopped on failure; .NET 11 propagates the exception from RunAsync/StopAsync) and replace the catch-all fix with guidance on exit-code consumers.
|
|
28
|
+
- Add a Contents list to core-libraries-dotnet10to11.md, csharp-compiler-dotnet10to11.md and efcore-dotnet10to11.md.
|
|
29
|
+
|
|
30
|
+
Executes or downloads: none. The imported text contains Docker and SDK version examples that were rewritten as guidance; this import runs nothing.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: migrate-dotnet10-to-dotnet11
|
|
3
|
+
description: Use when moving a .NET 10 project or solution to the .NET 11 SDK or adding a net11.0 target, or when a build or behavior change appears after that move. Not for new .NET 11 projects, other version upgrades or .NET Framework migrations.
|
|
4
|
+
license: MIT
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
<!-- Modified by Cratis from dotnet's original (MIT): frontmatter, scope, workflow and the changes listed in NOTICE. Upstream: https://github.com/dotnet/skills (plugins/dotnet-upgrade/skills/migrate-dotnet10-to-dotnet11/SKILL.md; see NOTICE) -->
|
|
8
|
+
|
|
9
|
+
# .NET 10 → .NET 11 migration
|
|
10
|
+
|
|
11
|
+
Cratis rules in `.cratis/ai/rules/` (including `csharp.md`) and the `cratis-*` skills win where they differ. This skill is a checklist of known breaking changes, not the exhaustive .NET 11 compatibility contract: confirm each change against the linked Microsoft compatibility page before teaching or applying a fix, and report contradictions instead of guessing.
|
|
12
|
+
|
|
13
|
+
## Scope
|
|
14
|
+
|
|
15
|
+
- Use for upgrading a repository's SDK, retargeting to `net11.0`, or diagnosing build errors and behavior changes after either.
|
|
16
|
+
- Do not use for greenfield projects, upgrades from .NET 9 or earlier, .NET Framework migrations, or cosmetic modernization unrelated to the upgrade.
|
|
17
|
+
- Distinguish the SDK and compiler version from the runtime target. A .NET 11 SDK (C# 15) can build `net10.0` targets; libraries that multi-target `net10.0;net11.0` keep both. Drop `net10.0` only when the repository's support policy says so.
|
|
18
|
+
- Follow the C# 14/15 feature guidance in [csharp.md](../../rules/csharp.md) instead of adopting language features here. In particular, no new public union types in libraries that also target `net10.0`, no `closed` on existing public types, and no runtime-async.
|
|
19
|
+
- Keep the repository's approved SDK pin (`global.json`) and package pins. With Central Package Management, change `Directory.Packages.props` only where the approved upgrade scope requires it.
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
|
|
23
|
+
| Input | Required | Description |
|
|
24
|
+
|-------|----------|-------------|
|
|
25
|
+
| Project or solution path | Yes | The `.csproj`, `.sln` or `.slnx` entry point to migrate |
|
|
26
|
+
| Build and test commands | No | The repository's gate commands; detect them from its guidance when not given |
|
|
27
|
+
| Technology areas | No | ASP.NET Core, EF Core, cryptography, containers; detect from SDK attributes and package references |
|
|
28
|
+
|
|
29
|
+
## Workflow
|
|
30
|
+
|
|
31
|
+
### Step 1: Assess
|
|
32
|
+
|
|
33
|
+
1. Find how the repository builds and tests, and which gates CI runs.
|
|
34
|
+
2. Run `dotnet --version` to confirm the approved SDK is installed. Stop and report if it is not; do not install one.
|
|
35
|
+
3. Identify the technology areas from the project:
|
|
36
|
+
- `Microsoft.NET.Sdk.Web` → ASP.NET Core; `Microsoft.EntityFrameworkCore.*` → EF Core.
|
|
37
|
+
- Cryptography, mTLS or macOS usage → cryptography reference.
|
|
38
|
+
- Compression, TAR or `NamedPipeClientStream` usage → core-libraries reference.
|
|
39
|
+
- `BackgroundService` usage → an exception from `ExecuteAsync` now makes `RunAsync`/`Run` throw, so the process exits non-zero (the host already stopped before).
|
|
40
|
+
- Dockerfiles, CI SDK versions, old hardware or NativeAOT → runtime and SDK references.
|
|
41
|
+
4. Establish a baseline with the repository's normal build on the current target, and record pre-existing warnings. Do not delete `bin`/`obj` unless the repository's guidance allows it.
|
|
42
|
+
|
|
43
|
+
### Step 2: Update targets within the approved scope
|
|
44
|
+
|
|
45
|
+
1. Where the upgrade scope includes the runtime target, add `net11.0` (`<TargetFrameworks>net10.0;net11.0</TargetFrameworks>` for libraries) or retarget applications. Keep `net10.0` in multi-targeted libraries.
|
|
46
|
+
2. Update Microsoft package versions only as far as the approved scope requires, in the existing central location.
|
|
47
|
+
3. Restore and build with the repository's commands. Capture all errors and warnings.
|
|
48
|
+
|
|
49
|
+
### Step 3: Resolve build errors
|
|
50
|
+
|
|
51
|
+
Read only the references that match the technology areas and the actual errors:
|
|
52
|
+
|
|
53
|
+
| Reference | Read when |
|
|
54
|
+
|-----------|-----------|
|
|
55
|
+
| [csharp-compiler-dotnet10to11.md](references/csharp-compiler-dotnet10to11.md) | A C# compiler error or warning appears after the SDK or target change |
|
|
56
|
+
| [core-libraries-dotnet10to11.md](references/core-libraries-dotnet10to11.md) | Code uses compression, TAR, `MemoryStream`, `NamedPipeClientStream`, `BackgroundService`, `Environment.TickCount` or the Japanese calendar |
|
|
57
|
+
| [sdk-msbuild-dotnet10to11.md](references/sdk-msbuild-dotnet10to11.md) | A restore, publish, pack or MSBuild warning appears, or CI and SDK settings change |
|
|
58
|
+
| [aspnetcore-dotnet10to11.md](references/aspnetcore-dotnet10to11.md) | The project uses ASP.NET Core OpenAPI or Blazor |
|
|
59
|
+
| [efcore-dotnet10to11.md](references/efcore-dotnet10to11.md) | The project uses Entity Framework Core, Cosmos DB or SQL Server |
|
|
60
|
+
| [cryptography-dotnet10to11.md](references/cryptography-dotnet10to11.md) | The project uses cryptography APIs, client certificates or runs on macOS |
|
|
61
|
+
| [runtime-jit-dotnet10to11.md](references/runtime-jit-dotnet10to11.md) | Deployment targets include older hardware, embedded devices or NativeAOT |
|
|
62
|
+
|
|
63
|
+
For each error, find the matching entry, confirm on the linked Microsoft page that it applies to the SDK and target in use, and apply the smallest documented fix. A change the references do not list is not proof the change is absent.
|
|
64
|
+
|
|
65
|
+
### Step 4: Review behavioral changes
|
|
66
|
+
|
|
67
|
+
Behavioral changes compile but change runtime results. Use the references to decide which apply to the code, and cover each applicable one with a test or an explicit decision:
|
|
68
|
+
|
|
69
|
+
- Compression, ZIP and TAR reading and writing behavior.
|
|
70
|
+
- `MemoryStream` capacity and exception types.
|
|
71
|
+
- `BackgroundService` exceptions that now propagate from `RunAsync` and change the exit code.
|
|
72
|
+
- Client certificate chain validation and cryptography availability by platform.
|
|
73
|
+
- EF Core provider behavior, including Cosmos DB async-only I/O.
|
|
74
|
+
- Hardware minimums and NativeAOT output names for the deployment targets.
|
|
75
|
+
|
|
76
|
+
### Step 5: Update infrastructure within scope
|
|
77
|
+
|
|
78
|
+
1. Dockerfiles and CI: change SDK or image tags only as far as the approved upgrade scope requires, using the repository's tag convention.
|
|
79
|
+
2. `global.json`: edit the existing file and preserve other keys such as `rollForward`; use the SDK version the repository approves.
|
|
80
|
+
3. Verify deployment targets meet the hardware requirements in the runtime reference.
|
|
81
|
+
|
|
82
|
+
### Step 6: Verify
|
|
83
|
+
|
|
84
|
+
1. Run the repository's full gates: build, tests and any CI checks for the changed projects.
|
|
85
|
+
2. Build and test container images when the repository ships them.
|
|
86
|
+
3. A clean build does not finish an upgrade. Run behavioral tests for the applicable changes from Step 4 and review the diff for unintended behavior changes.
|
|
87
|
+
4. Report which references were consulted, which Microsoft pages confirmed applicability, and which gates were run.
|
|
88
|
+
|
|
89
|
+
## Pitfalls
|
|
90
|
+
|
|
91
|
+
| Pitfall | Correction |
|
|
92
|
+
|---------|------------|
|
|
93
|
+
| Dropping `net10.0` because the SDK is 11 | The SDK version is not the target; keep supported targets |
|
|
94
|
+
| Upgrading every Microsoft package to 11.x | Change only pinned versions the approved scope requires |
|
|
95
|
+
| Treating the bundled references as complete | They are a starting checklist; verify against Microsoft documentation |
|
|
96
|
+
| Declaring done after a clean build | Run behavioral tests and CI gates |
|
|
97
|
+
| Adopting C# 15 features during the migration | Follow `csharp.md`; migration is not a feature change |
|
package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/aspnetcore-dotnet10to11.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# ASP.NET Core Breaking Changes (.NET 11)
|
|
2
|
+
|
|
3
|
+
These breaking changes affect ASP.NET Core projects. Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/11
|
|
4
|
+
|
|
5
|
+
> **Note:** This checklist was captured from .NET 11 preview-era compatibility documentation and is not the exhaustive release contract. Confirm each item against the linked Microsoft compatibility page for the SDK and runtime in use before applying a fix.
|
|
6
|
+
|
|
7
|
+
## Source-Incompatible Changes
|
|
8
|
+
|
|
9
|
+
### Microsoft.OpenApi updated to v3 with OpenAPI 3.2 support
|
|
10
|
+
|
|
11
|
+
**Impact: Medium.** `Microsoft.AspNetCore.OpenApi` updated its dependency from `Microsoft.OpenApi` 2.x to 3.x, adding OpenAPI 3.2 document generation. The underlying `Microsoft.OpenApi` library has breaking API changes in the v2→v3 transition.
|
|
12
|
+
|
|
13
|
+
Code that directly uses `Microsoft.OpenApi` types (`OpenApiDocument`, `OpenApiSchema`, `OpenApiOperation`, etc.) will have compile errors.
|
|
14
|
+
|
|
15
|
+
**Fix:** Follow the [Microsoft.OpenApi v3 upgrade guide](https://github.com/microsoft/OpenAPI.NET/blob/main/docs/upgrade-guide-3.md). If you only use the ASP.NET Core OpenAPI integration (`.WithOpenApi()`, `MapOpenApi()`) without touching the object model directly, no changes are needed.
|
|
16
|
+
|
|
17
|
+
## Behavioral Changes
|
|
18
|
+
|
|
19
|
+
### Blazor Virtualize<T> default OverscanCount changed from 3 to 15
|
|
20
|
+
|
|
21
|
+
**Impact: Low.** The default `OverscanCount` on the `Virtualize<TItem>` component changed from `3` to `15` to support variable-height item measurement. `QuickGrid` retains its own default of `3`.
|
|
22
|
+
|
|
23
|
+
**Fix:** If performance-sensitive, set `OverscanCount` explicitly: `<Virtualize OverscanCount="3" />`.
|
|
24
|
+
|
package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/core-libraries-dotnet10to11.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# Core .NET Libraries Breaking Changes (.NET 11)
|
|
2
|
+
|
|
3
|
+
## Contents
|
|
4
|
+
|
|
5
|
+
- Obsoleted APIs
|
|
6
|
+
- Behavioral Changes
|
|
7
|
+
|
|
8
|
+
## Obsoleted APIs
|
|
9
|
+
|
|
10
|
+
These breaking changes affect all .NET 11 projects regardless of application type. Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/11
|
|
11
|
+
|
|
12
|
+
> **Note:** This checklist was captured from .NET 11 preview-era compatibility documentation and is not the exhaustive release contract. Confirm each item against the linked Microsoft compatibility page for the SDK and runtime in use before applying a fix.
|
|
13
|
+
|
|
14
|
+
### NamedPipeClientStream constructor with `isConnected` parameter obsoleted (SYSLIB0063)
|
|
15
|
+
|
|
16
|
+
**Impact: High (for projects using `TreatWarningsAsErrors`).** The `NamedPipeClientStream` constructor overload that accepts a `bool isConnected` parameter has been obsoleted. The `isConnected` argument never had any effect — pipes created from an existing `SafePipeHandle` are always connected. A new constructor without the parameter has been added.
|
|
17
|
+
|
|
18
|
+
```csharp
|
|
19
|
+
// .NET 10: compiles without warning
|
|
20
|
+
var pipe = new NamedPipeClientStream(PipeDirection.InOut, isAsync: true, isConnected: true, safePipeHandle);
|
|
21
|
+
|
|
22
|
+
// .NET 11: SYSLIB0063 warning (error with TreatWarningsAsErrors)
|
|
23
|
+
// Fix: remove the isConnected parameter
|
|
24
|
+
var pipe = new NamedPipeClientStream(PipeDirection.InOut, isAsync: true, safePipeHandle);
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**Fix:** Remove the `isConnected` argument and use the new 3-parameter constructor `NamedPipeClientStream(PipeDirection, bool isAsync, SafePipeHandle)`.
|
|
28
|
+
|
|
29
|
+
## Behavioral Changes
|
|
30
|
+
|
|
31
|
+
### DeflateStream and GZipStream write headers and footers for empty payloads
|
|
32
|
+
|
|
33
|
+
**Impact: Medium.** `DeflateStream` and `GZipStream` now always write format headers and footers to the output stream, even when no data is written. Previously, these streams produced no output for empty payloads.
|
|
34
|
+
|
|
35
|
+
This ensures the output is a valid compressed stream per the Deflate and GZip specifications, but code that checks for zero-length output will need updating.
|
|
36
|
+
|
|
37
|
+
```csharp
|
|
38
|
+
// .NET 10: output stream is empty (0 bytes)
|
|
39
|
+
// .NET 11: output stream contains valid headers/footers
|
|
40
|
+
using var ms = new MemoryStream();
|
|
41
|
+
using (var gz = new GZipStream(ms, CompressionMode.Compress, leaveOpen: true))
|
|
42
|
+
{
|
|
43
|
+
// write nothing
|
|
44
|
+
}
|
|
45
|
+
// ms.Length was 0 in .NET 10, now > 0 in .NET 11
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
**Fix:** If your code checks for empty output to detect "no data was compressed," check the uncompressed byte count instead, or adjust the length check to account for headers/footers.
|
|
49
|
+
|
|
50
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/11/deflatestream-gzipstream-empty-payload
|
|
51
|
+
|
|
52
|
+
### MemoryStream maximum capacity updated and exception behavior changed
|
|
53
|
+
|
|
54
|
+
**Impact: Medium.** The maximum capacity of `MemoryStream` has been updated and the exception behavior for exceeding capacity has changed.
|
|
55
|
+
|
|
56
|
+
**Fix:** Review code that creates very large `MemoryStream` instances or catches specific exception types related to capacity limits.
|
|
57
|
+
|
|
58
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/11/memorystream-max-capacity
|
|
59
|
+
|
|
60
|
+
### TAR-reading APIs verify header checksums when reading
|
|
61
|
+
|
|
62
|
+
**Impact: Medium.** TAR-reading APIs now verify header checksums during reading. Previously, invalid checksums were silently ignored.
|
|
63
|
+
|
|
64
|
+
```csharp
|
|
65
|
+
// .NET 11: throws if TAR header checksum is invalid
|
|
66
|
+
using var reader = new TarReader(stream);
|
|
67
|
+
var entry = reader.GetNextEntry(); // may throw for corrupted files
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Fix:** Ensure TAR files have valid checksums. If processing hand-crafted or legacy TAR files, add error handling for checksum validation failures.
|
|
71
|
+
|
|
72
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/11/tar-checksum-validation
|
|
73
|
+
|
|
74
|
+
### ZipArchive.CreateAsync eagerly loads ZIP archive entries
|
|
75
|
+
|
|
76
|
+
**Impact: Low.** `ZipArchive.CreateAsync` now eagerly loads ZIP archive entries instead of lazy loading. This may affect memory usage for very large archives.
|
|
77
|
+
|
|
78
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/11/ziparchive-createasync-eager-load
|
|
79
|
+
|
|
80
|
+
### Environment.TickCount made consistent with Windows timeout behavior
|
|
81
|
+
|
|
82
|
+
**Impact: Low.** `Environment.TickCount` behavior has been made consistent with Windows timeout behavior. Code that relies on specific tick count wrapping or comparison patterns may need adjustment.
|
|
83
|
+
|
|
84
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/11/environment-tickcount-windows-behavior
|
|
85
|
+
|
|
86
|
+
### Globalization: Japanese Calendar minimum supported date corrected
|
|
87
|
+
|
|
88
|
+
**Impact: Low.** The minimum supported date for the Japanese Calendar has been corrected. Code using very early dates in the Japanese Calendar may be affected.
|
|
89
|
+
|
|
90
|
+
Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/globalization/11/japanese-calendar-min-date
|
|
91
|
+
|
|
92
|
+
### ZipArchive now validates CRC32 when reading entries
|
|
93
|
+
|
|
94
|
+
**Impact: Low–Medium.** ZIP archive reads now validate the CRC32 checksum of each entry. Previously, corrupt or truncated archives were silently accepted; they now throw `InvalidDataException`.
|
|
95
|
+
|
|
96
|
+
**Fix:** Ensure ZIP files are not corrupted. If processing partially-written or legacy archives, add error handling for `InvalidDataException`.
|
|
97
|
+
|
|
98
|
+
### BackgroundService failures now propagate from the host
|
|
99
|
+
|
|
100
|
+
**Impact: Medium.** Since .NET 6 the default `BackgroundServiceExceptionBehavior.StopHost` already stops the host when `ExecuteAsync()` throws. What changes in .NET 11 is how that stop is reported: `IHost.RunAsync()`/`StopAsync()` (and so `Run()`) now rethrow the background service exception instead of returning normally, so the process exits with a non-zero code.
|
|
101
|
+
|
|
102
|
+
```csharp
|
|
103
|
+
// .NET 10: host stops, RunAsync returns normally, exit code 0
|
|
104
|
+
// .NET 11: host stops, RunAsync throws the service's exception, exit code non-zero
|
|
105
|
+
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
|
106
|
+
{
|
|
107
|
+
throw new InvalidOperationException("oops");
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Fix:** Do not add a catch-all in `ExecuteAsync()` to restore the old exit code; that hides real failures and keeps the host running in a broken state. Instead, check callers of `RunAsync()`/`Run()`, scripts, health checks and orchestrators that relied on a zero exit code after a background failure, and handle or log the propagated exception at the host entry point where that is intended. Services that must keep running after a recoverable error should handle that specific error inside their work loop.
|
|
112
|
+
|
|
113
|
+
### TarWriter emits HardLink entries for hard-linked files
|
|
114
|
+
|
|
115
|
+
**Impact: Low.** When `TarWriter` archives a directory containing hard links, the same inode encountered more than once is now written as a `HardLink` entry pointing back to the first occurrence, rather than duplicating the file data.
|
|
116
|
+
|
|
117
|
+
**Fix:** If consuming tar archives produced by .NET code, ensure the reader handles `HardLink` entry types.
|
|
118
|
+
|
|
119
|
+
### Zstandard APIs moved from preview package to System.IO.Compression
|
|
120
|
+
|
|
121
|
+
**Impact: Low.** `ZstandardStream` and related APIs that were previously in the `System.IO.Compression.Zstandard` preview NuGet package are now in-box in `System.IO.Compression`.
|
|
122
|
+
|
|
123
|
+
**Fix:** Remove the `<PackageReference Include="System.IO.Compression.Zstandard" />` preview package if present. The APIs are now available without any additional package reference.
|
|
124
|
+
|
package/package/corpus/skills/migrate-dotnet10-to-dotnet11/references/cryptography-dotnet10to11.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Cryptography Breaking Changes (.NET 11)
|
|
2
|
+
|
|
3
|
+
These breaking changes affect projects using cryptography APIs. Source: https://learn.microsoft.com/en-us/dotnet/core/compatibility/11
|
|
4
|
+
|
|
5
|
+
> **Note:** This checklist was captured from .NET 11 preview-era compatibility documentation and is not the exhaustive release contract. Confirm each item against the linked Microsoft compatibility page for the SDK and runtime in use before applying a fix.
|
|
6
|
+
|
|
7
|
+
## Behavioral Changes
|
|
8
|
+
|
|
9
|
+
### DSA removed from macOS
|
|
10
|
+
|
|
11
|
+
**Impact: Medium (macOS only).** DSA (Digital Signature Algorithm) has been removed from macOS. Code that uses DSA for signing or verification will throw on macOS.
|
|
12
|
+
|
|
13
|
+
```csharp
|
|
14
|
+
// BREAKS on macOS in .NET 11
|
|
15
|
+
using var dsa = DSA.Create();
|
|
16
|
+
var signature = dsa.SignData(data, HashAlgorithmName.SHA256);
|
|
17
|
+
|
|
18
|
+
// FIX: Use a different algorithm
|
|
19
|
+
using var ecdsa = ECDsa.Create();
|
|
20
|
+
var signature = ecdsa.SignData(data, HashAlgorithmName.SHA256);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
**Fix:** Migrate from DSA to a more modern algorithm:
|
|
24
|
+
- **ECDSA** — recommended replacement for digital signatures
|
|
25
|
+
- **RSA** — alternative if ECDSA is not suitable
|
|
26
|
+
- **Ed25519** — if available in your scenario
|
|
27
|
+
|
|
28
|
+
This change only affects macOS. DSA continues to work on Windows and Linux (though it is generally considered a legacy algorithm).
|
|
29
|
+
|
|
30
|
+
### AIA certificate downloads disabled by default during client-certificate validation
|
|
31
|
+
|
|
32
|
+
**Impact: Medium.** AIA (Authority Information Access) certificate downloads are now disabled by default when performing server-side client-certificate chain validation. Previously the runtime would attempt to fetch intermediate CA certificates online.
|
|
33
|
+
|
|
34
|
+
**Fix:** If using mTLS where client certificates rely on AIA URLs for intermediate CAs, either:
|
|
35
|
+
- Pre-install the full certificate chain on the server
|
|
36
|
+
- Have clients send the full chain including intermediates
|
|
37
|
+
- Re-enable AIA downloads via `X509ChainPolicy.DisableCertificateDownloads = false`
|
|
38
|
+
|