Visitar URL original
Treat package references injected by custom SDKs as auto-referenced by thomhurst · Pull Request #795 · dotnet-outdated/dotnet-outdated · GitHub
Skip to content

Treat package references injected by custom SDKs as auto-referenced - #795

Merged
slang25 merged 14 commits into
dotnet-outdated:masterfrom
thomhurst:fix/sdk-injected-package-references
Nov 8, 2026
Merged

slang25 merged 14 commits into
dotnet-outdated:masterfrom
thomhurst:fix/sdk-injected-package-references

Conversation

@thomhurst

@thomhurst thomhurst commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #794
Relates to #589

Problem

SDKs that are resolved from NuGet, such as MSTest.Sdk and Cake.Sdk, add PackageReference items in their own props and targets files. They don't mark these items IsImplicitlyDefined, so the restore graph doesn't flag them as auto-referenced. dotnet-outdated then reported them as direct dependencies:

» mst
  [net8.0]
  Microsoft.NET.Test.Sdk                     17.11.0 -> 18.10.1
  MSTest.TestAdapter                         3.6.0   -> 4.4.1
  MSTest.TestFramework                       3.6.0   -> 4.4.1
  ...

The SDK sets these versions, so -u could not upgrade them. With Cake.Sdk the upgrade failed with exit code 3. With MSTest.Sdk, dotnet add package could add duplicate references to the project (#589).

Fix

  • When a project declares an SDK outside the Microsoft.NET.Sdk* family, ProjectAnalysisService evaluates its PackageReference items for each target framework. It uses the new IDependencyGraphService.GetPackageReferenceItems, which runs dotnet msbuild -getItem:PackageReference -p:TargetFramework=<alias>. The SDK can be declared in the Sdk attribute, an <Sdk> element or <Import Sdk>.
  • A direct dependency is marked auto-referenced when every one of its items is defined in a file inside the NuGet global packages folder or a fallback folder. In practice, that file belongs to an SDK or package, not to the repository. The dependency is then treated like the SDK's other implicit references:
    • It is hidden by default.
    • It is shown with [A] under --include-auto-references.
  • A package the user references explicitly in the project or in Directory.*.props is still reported normally. This holds even when the SDK also references it, because at least one of its items is defined outside the package folders.
  • Projects that use only Microsoft.NET.Sdk* SDKs skip the extra evaluation. On my machine the evaluation took about 0.4 s for each target framework.
  • GetPackageReferenceItems is a default interface method that returns an empty list. This avoids a breaking change for other implementers of the public IDependencyGraphService in DotNetOutdatedTool.Core.

The right way to upgrade these packages is to bump the SDK version. #793 adds that for versioned SDKs in project files. With both PRs, the main MSTest.Sdk case in #589 is handled: the SDK is offered as the upgrade, and its injected packages are no longer reported. With -t, the transitive dependencies of those packages are still listed, as they are for other auto-referenced packages.

Tests

  • DependencyGraphServiceTests:
    • Parse the -getItem JSON output and check the msbuild arguments.
    • Return an empty list when evaluation fails or the output is malformed.
  • EndToEndTests use a new sdk-injected-packages fixture: MSTest.Sdk/3.6.0 on net8.0 with an explicit Newtonsoft.Json reference.
    • With default options, Newtonsoft.Json is reported and the MSTest packages are not.
    • With --include-auto-references, the MSTest packages are reported too.
    • --upgrade succeeds, updates Newtonsoft.Json and adds no MSTest references to the project.

All tests pass locally on net8.0 and net9.0. I also checked by hand that the Cake.Sdk repro from #794 now reports only the explicit package.

Notes

Maintainer follow-up commits

Added on top of the original commit after review:

  • Directory.Build.* SDKs: SDKs imported with <Import Sdk> from a Directory.Build.props or Directory.Build.targets file in the project's directory or above are now detected. Before, only the project file was checked.
  • RestorePackagesPath: NuGet's configured global packages folder is now checked too. With a custom RestorePackagesPath, the SDK is still loaded from the global folder, so the fix did nothing in that setup before.
  • Speed: the per-project, per-target-framework evaluations now run concurrently, limited to the processor count across all projects. For a solution of 20 two-TFM projects that use a custom SDK, the run time went from about 25 s to 5–7 s (master: about 5 s).
  • Failures are logged: GetPackageReferenceItems returns null when dotnet msbuild fails or prints output that is not JSON, and the failure is logged at verbose level.
  • SDK name check: only Microsoft.NET.Sdk and Microsoft.NET.Sdk.* skip the evaluation, instead of any name that starts with Microsoft.NET.Sdk.
  • Tests: the logic now lives in an internal SdkInjectedPackageReferences helper with offline unit tests. A new sdk-injected-packages-restore-path end-to-end fixture covers RestorePackagesPath.
  • README: documents how SDK-added packages are reported, and that SDKs imported from files other than the project and Directory.Build.* are not detected.

thomhurst and others added 8 commits September 30, 2026 22:44
SDKs resolved from NuGet, such as MSTest.Sdk and Cake.Sdk, add
PackageReference items from their own props and targets files without
marking them implicitly defined. dotnet-outdated reported these as
direct dependencies, and upgrading them with `dotnet add package`
failed or added a duplicate reference to the project, because their
version comes from the SDK.

When a project declares an SDK outside the Microsoft.NET.Sdk family,
evaluate its PackageReference items per target framework with
`dotnet msbuild -getItem:PackageReference`. A direct dependency whose
items are all defined in files inside a NuGet package folder is marked
as auto-referenced. It is then hidden by default and shown with [A]
under --include-auto-references, like the SDK's own implicit
references.

Projects that only use Microsoft.NET.Sdk* SDKs skip the extra
evaluation.

Fixes dotnet-outdated#794
Relates to dotnet-outdated#589
The SDK detection, package folder check and marking were private
methods of ProjectAnalysisService, so they were only covered by
end-to-end tests that restore MSTest.Sdk from nuget.org. Move them to
an internal SdkInjectedPackageReferences helper and test it offline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prefix check also skipped any SDK whose name merely starts with
Microsoft.NET.Sdk, such as a third-party Microsoft.NET.SdkExtras.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A repository can import a custom SDK for all of its projects with an
<Import Sdk> in a Directory.Build.props or Directory.Build.targets
file. Only the project file was checked, so the injected packages of
such projects were still reported and their upgrade still failed.
Check every Directory.Build.* file from the project's directory up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restore puts packages in RestorePackagesPath when a project sets it,
but the NuGet SDK resolver still loads SDKs from the global packages
folder in the NuGet settings. The SDK's files were then outside every
folder that was checked, so its injected packages were still reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each project and target framework that uses a custom SDK needs its own
dotnet msbuild evaluation of about 0.4 s. They ran one after another
for every project in a solution: 20 two-TFM projects took about 25 s
instead of about 5 s. Run them concurrently, limited to the processor
count across all projects being analyzed. The same solution now takes
5-7 s. Also look up the package folders once per project, not per
target framework.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GetPackageReferenceItems returned an empty list both when a project
had no items and when dotnet msbuild failed or printed output that was
not JSON, so a failure fell back to the old behavior without a trace.
Return null on failure and log it at verbose level.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slang25 added a commit to thomhurst/dotnet-outdated that referenced this pull request Nov 8, 2026
Discovery used regular expressions over the raw project file, so an SDK
inside an XML comment was reported as outdated, and a commented-out
<Project Sdk="..."> line above the real root shadowed the real version.

Add ProjectSdkReferenceHelper.GetDeclarations, which parses the project
file with XDocument and returns every declared SDK (the Project Sdk
attribute, <Sdk> elements and <Import Sdk> elements, versioned or not).
Discover now builds on it. The declaration list is meant to be shared with
other SDK-aware code, such as the custom-SDK check in dotnet-outdated#795.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slang25
slang25 requested a balanced review from Copilot November 8, 2026 12:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Unresolved package-classification bugs can hide user-controlled versions or misreport dependencies when references use Update overrides, runtime conditions, or case-distinct Linux paths.

3 open issues
What changed in this PR

This PR treats packages injected by custom MSBuild SDKs as auto-referenced, preventing default reporting and upgrade attempts for SDK-controlled dependencies. It addresses the MSTest.Sdk and Cake.Sdk cases and complements the SDK-version upgrade support in #793.

Changes:

  • Detects custom SDK declarations and evaluates package-reference origins per target framework, with bounded concurrency.
  • Checks restore, global, and fallback package folders while preserving separately declared user references.
  • Adds unit tests, end-to-end fixtures, and documentation for the behavior and detection limits.
File Description
test/​DotNetOutdated.Tests/​SdkInjectedPackageReferencesTests.cs Tests SDK detection and package-origin classification.
test/​DotNetOutdated.Tests/​EndToEndTests.cs Tests reporting and upgrades with SDK-injected packages.
test/​DotNetOutdated.Tests/​DependencyGraphServiceTests.cs Tests evaluation arguments, JSON parsing, and failures.
test-projects/​sdk-injected-packages/​sdk-injected-packages.csproj Adds an MSTest SDK fixture with an explicit package.
test-projects/​sdk-injected-packages-restore-path/​sdk-injected-packages-restore-path.csproj Adds the custom restore-path fixture project.
test-projects/​sdk-injected-packages-restore-path/​Directory.Build.props Configures project-local package restoration.
src/​DotNetOutdated.Core/​Services/​SdkInjectedPackageReferences.cs Detects custom SDKs and classifies injected references.
src/​DotNetOutdated.Core/​Services/​ProjectAnalysisService.cs Integrates throttled evaluations and package-folder discovery.
src/​DotNetOutdated.Core/​Services/​IDependencyGraphService.cs Adds a compatible evaluation API and reference model.
src/​DotNetOutdated.Core/​Services/​DependencyGraphService.cs Evaluates package references through MSBuild.
README.md Documents auto-reference behavior and detection limits.

Review effort: Balanced

slang25 and others added 3 commits November 8, 2026 12:17
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restore graph is generated with /p:RuntimeIdentifiers when
--runtime is set, but the PackageReference evaluation only got the
target framework, so runtime-conditioned references could be
classified against a different set of items. Pass the same property.

Addresses Copilot review feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The package folder check ignored case on every platform. On Linux, a
user's file in /repo/Packages was then treated as inside a packages
folder at /repo/packages, and its references were hidden. Compare
paths case-sensitively on Linux; package ids still ignore case.

Addresses Copilot review feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
slang25 added a commit that referenced this pull request Nov 8, 2026
* Support versioned MSBuild project SDKs in project files

Project files can pin an MSBuild project SDK version with
<Project Sdk="Aspire.AppHost.Sdk/13.0.0"> or
<Sdk Name="Aspire.AppHost.Sdk" Version="13.0.0" />. These SDKs were
never reported as outdated, so projects such as Aspire app hosts kept
an old SDK after an upgrade while their packages moved forward.

- Discover literal versioned SDKs in the project file and report them
  as direct dependencies of every target framework
- Upgrade them by rewriting the version in place, because
  `dotnet add package` cannot update an SDK; the rest of the project
  file keeps its formatting
- Treat a project that declares SDKs only through <Sdk> elements as
  SDK-style, so its packages are not removed before an upgrade
- Skip SDK versions that use MSBuild properties or come from
  global.json msbuild-sdks

Fixes #694

* Parse project SDK declarations as XML so commented-out SDKs are ignored

Discovery used regular expressions over the raw project file, so an SDK
inside an XML comment was reported as outdated, and a commented-out
<Project Sdk="..."> line above the real root shadowed the real version.

Add ProjectSdkReferenceHelper.GetDeclarations, which parses the project
file with XDocument and returns every declared SDK (the Project Sdk
attribute, <Sdk> elements and <Import Sdk> elements, versioned or not).
Discover now builds on it. The declaration list is meant to be shared with
other SDK-aware code, such as the custom-SDK check in #795.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Skip XML comments when rewriting project SDK versions

The text-based update rewrote SDK versions inside comments, and the
first <Project Sdk="..."> match could be a commented-out line above the
real root, which left the real SDK untouched while reporting success.

Match against a copy of the file with comments and CDATA blanked out to
spaces of the same length, then apply the edits to the original by index,
so the formatting of the rest of the file is still preserved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Support versioned SDKs declared with <Import Sdk="..." Version="...">

MSBuild has a third way to pin a project SDK version, an explicit
<Import Project="Sdk.props" Sdk="Id" Version="..."> pair. These SDKs were
not reported, and a project that declared its SDK only this way was not
treated as SDK-style, so its packages were removed before an upgrade.

Discover and update the Import form, count it in IsProjectSdkStyle, and add
a project-sdk-import end-to-end fixture.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep the byte order mark when rewriting a project SDK version

File.WriteAllText writes UTF-8 without a byte order mark, so a project file
saved by Visual Studio (UTF-8 with BOM) got a spurious first-line diff after
an SDK upgrade. Detect the encoding when reading and write the file back
with it. Line endings were already preserved; the test now covers both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Report a failed SDK upgrade instead of crashing when the project is read-only

Writing the new SDK version into a read-only or locked project file threw
an unhandled UnauthorizedAccessException, which ended the whole run and
skipped every remaining upgrade. Return a failed RunStatus instead, the
same way a failing `dotnet add package` is reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Restore once, not once per target framework, after an SDK upgrade

The upgrade loop calls AddPackage for every target framework of a
multi-targeted project. The first call rewrites the SDK version and
restores; later calls found the file already at the requested version and
restored the whole project again. Return success without restoring when
nothing changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check the upgraded SDK version in the end-to-end SDK test

The test only asserted that the original declaration string was gone,
which would also pass if the version were mangled. Read the SDK back from
the project file and assert it parses and is newer than 3.7.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Make SDK version rewrite quote-aware so '>' in an attribute value doesn't end the tag

Copilot review: a valid declaration such as
<Import Project="Sdk.props" Condition="'1' > '0'" Sdk="X" Version="1.0.0" />
was cut off at the '>' inside Condition, so discovery found the SDK but the
rewrite missed it and one of a pair of imports could be left behind.

Match <Project>, <Sdk> and <Import> start tags with one quote-aware pattern
and read their attributes in sequence, so text inside another attribute's
quoted value (for example Label="Version='1.0.0'") is never mistaken for an
attribute either.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Ignore <ProjectExtensions> when discovering and rewriting project SDKs

Copilot review: the rewrite scanned every <Sdk> tag in the file, unlike
discovery, so an <Sdk> element with the same name inside
<ProjectExtensions> (free-form XML that MSBuild ignores) had its Version
overwritten. Discovery likewise picked up <Import Sdk> elements there.

Blank out <ProjectExtensions> along with comments and CDATA before
matching, and skip elements under it in GetDeclarations, so both only see
real declarations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Stuart Lang <stuart.b.lang@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
slang25 and others added 2 commits November 8, 2026 12:40
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Replace the XML parsing in SdkInjectedPackageReferences with
ProjectSdkReferenceHelper.GetDeclarations, so project files and
Directory.Build.* files are read the same way for SDK upgrades and for
SDK-injected package references. Comments and ProjectExtensions are
now ignored here too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The predicate incorrectly marks a same-ID declared SDK as auto-referenced, hiding its upgrade from default reporting; SDK-keyed entries need exclusion and a regression test.

1 open issue
3 resolved since last review

Review effort: Balanced

dotnet-outdated#793 adds declared SDKs to the dependencies under a {name}#sdk key.
When an SDK injected a package with the same id as a declared SDK,
both entries were marked auto-referenced and the SDK upgrade was
hidden. Only mark package entries.

Addresses Copilot review feedback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@slang25 slang25 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed and tested; changes applied on top. Thanks!

@slang25
slang25 merged commit f1c0888 into dotnet-outdated:master Nov 8, 2026
11 checks passed
slang25 added a commit to GREsau/dotnet-outdated that referenced this pull request Nov 8, 2026
Brings in dotnet-outdated#795 (SDK-injected package references treated as auto-referenced).
No conflicts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slang25 slang25 mentioned this pull request Nov 8, 2026
ptr727-codegen Bot pushed a commit to ptr727/LanguageTags that referenced this pull request Nov 10, 2026
Updated
[dotnet-outdated-tool](https://github.com/dotnet-outdated/dotnet-outdated)
from 4.8.1 to 4.9.0.

<details>
<summary>Release notes</summary>

_Sourced from [dotnet-outdated-tool's
releases](https://github.com/dotnet-outdated/dotnet-outdated/releases)._

## 4.9.0

## What's Changed
* Adopt MCP 2026-07-28 spec with legacy version negotiation by @​slang25
in dotnet-outdated/dotnet-outdated#772
* Fix concurrent cache corruption during recursive file-based app
upgrades by @​DamianEdwards in
dotnet-outdated/dotnet-outdated#788
* Fix: Parameter --maximum-version ignores exact version references by
@​chefarbeiter in
dotnet-outdated/dotnet-outdated#671
* Show a friendly message instead of crashing when a solution has no
projects by @​DanielC000 in
dotnet-outdated/dotnet-outdated#771
* Surface package-upgrade stdout so failures are diagnosable by
@​timabell in
dotnet-outdated/dotnet-outdated#790
* Fix multiline central package version updates by @​onuracar-dev in
dotnet-outdated/dotnet-outdated#783
* Support versioned MSBuild project SDKs in project files by @​thomhurst
in dotnet-outdated/dotnet-outdated#793
* Preserve whitespace in Directory.Packages.props during upgrades by
@​symbiogenesis in
dotnet-outdated/dotnet-outdated#803
* Treat package references injected by custom SDKs as auto-referenced by
@​thomhurst in
dotnet-outdated/dotnet-outdated#795
* Preserve version ranges when upgrading packages by @​GREsau in
dotnet-outdated/dotnet-outdated#702
* Preserve MSBuild version variables across project and props files by
@​symbiogenesis in
dotnet-outdated/dotnet-outdated#805
* Replace McMaster command-line parsing with System.CommandLine by
@​slang25 in dotnet-outdated/dotnet-outdated#808
* Bump version to 4.9.0 by @​slang25 in
dotnet-outdated/dotnet-outdated#806

## New Contributors
* @​chefarbeiter made their first contribution in
dotnet-outdated/dotnet-outdated#671
* @​DanielC000 made their first contribution in
dotnet-outdated/dotnet-outdated#771
* @​timabell made their first contribution in
dotnet-outdated/dotnet-outdated#790
* @​onuracar-dev made their first contribution in
dotnet-outdated/dotnet-outdated#783
* @​thomhurst made their first contribution in
dotnet-outdated/dotnet-outdated#793
* @​GREsau made their first contribution in
dotnet-outdated/dotnet-outdated#702

**Full Changelog**:
dotnet-outdated/dotnet-outdated@v4.8.1...v4.9.0


Commits viewable in [compare
view](dotnet-outdated/dotnet-outdated@v4.8.1...v4.9.0).
</details>

Updated [ptr727.Utilities](https://github.com/ptr727/Utilities) from
4.1.105 to 4.1.109.

<details>
<summary>Release notes</summary>

_Sourced from [ptr727.Utilities's
releases](https://github.com/ptr727/Utilities/releases)._

## 4.1.109

## What's Changed
* Bump the actions-deps group with 4 updates by @​dependabot[bot] in
ptr727/Utilities#574
* Bump the nuget-deps group with 2 updates by @​dependabot[bot] in
ptr727/Utilities#576
* Resync the Instruction Set With the Hub by @​ptr727 in
ptr727/Utilities#581
* Resync the Skills Tree and Markdownlint Config With the Hub by
@​ptr727 in ptr727/Utilities#578
* Bring the Publisher Concurrency and Aggregator Name to the Workflow
Contract by @​ptr727 in ptr727/Utilities#579
* Reconcile the Intent-Fidelity Carried Files With the Hub by @​ptr727
in ptr727/Utilities#580
* Promote the Hub Resync to Main by @​ptr727 in
ptr727/Utilities#582


**Full Changelog**:
ptr727/Utilities@4.1.108...4.1.109

## 4.1.108

## What's Changed
* Bump the actions-deps group with 4 updates by @​dependabot[bot] in
ptr727/Utilities#575
* Bump the nuget-deps group with 2 updates by @​dependabot[bot] in
ptr727/Utilities#577


**Full Changelog**:
ptr727/Utilities@4.1.105...4.1.108

Commits viewable in [compare
view](ptr727/Utilities@4.1.105...4.1.109).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
ptr727 added a commit to ptr727/NxWitness that referenced this pull request Nov 11, 2026
Updated [csharpier](https://github.com/belav/csharpier) from 1.3.0 to
1.4.0.

<details>
<summary>Release notes</summary>

_Sourced from [csharpier's
releases](https://github.com/belav/csharpier/releases)._

## 1.4.0

## Breaking Changes
### Drop support for net8.0 and net9.0
[#​1888](belav/csharpier#1888)
CSharpier and CSharpier.MsBuild now target `net10.0` and `net11.0`.
CSharpier.Core targets `net10.0`, `net11.0` and `netstandard2.0`.

## What's Changed
### Feature: Support for .NET 11 and C# 15
[#​1888](belav/csharpier#1888)
CSharpier now supports the new syntax in C# 15.
```c#
public union Pet(Cat, Dog, Bird);

public closed record GateState;

HashSet<string> set = [with(StringComparer.OrdinalIgnoreCase), "Hello", "HELLO", "hello"];

outer:
for (int row = 0; row < grid.Height; row++)
{
    for (int column = 0; column < grid.Width; column++)
    {
        if (grid[row, column].IsBlocked)
        {
            continue outer;
        }

        if (grid[row, column].IsGoal)
        {
            break outer;
        }
    }
}
```

### Feature: Avoid chopping single trailing lambda
[#​1865](belav/csharpier#1865)
When the last argument is a lambda with a block body, and the arguments
up to and including the `=>` fit on one line, CSharpier now keeps them
on the same line as the method name.
```c#
// input & expected output
logging.AddFile(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "server{0}.log"), o =>
{
    o.MaxRollingFiles = 1;
});

// 1.3.0
logging.AddFile(
    Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "server{0}.log"),
    o =>
    {
        o.MaxRollingFiles = 1;
    }
);
```
 ... (truncated)

## 1.3.11-beta1



## 1.3.6

# 1.3.6
## What's Changed
#### Fix bug where 2nd instance of VSCode was not able to format code
[#​784](belav/csharpier#784)

Thanks to @​BenasB for reporting the issue

Commits viewable in [compare
view](belav/csharpier@1.3.0...1.4.0).
</details>

Updated
[dotnet-outdated-tool](https://github.com/dotnet-outdated/dotnet-outdated)
from 4.8.1 to 4.9.0.

<details>
<summary>Release notes</summary>

_Sourced from [dotnet-outdated-tool's
releases](https://github.com/dotnet-outdated/dotnet-outdated/releases)._

## 4.9.0

## What's Changed
* Adopt MCP 2026-07-28 spec with legacy version negotiation by @​slang25
in dotnet-outdated/dotnet-outdated#772
* Fix concurrent cache corruption during recursive file-based app
upgrades by @​DamianEdwards in
dotnet-outdated/dotnet-outdated#788
* Fix: Parameter --maximum-version ignores exact version references by
@​chefarbeiter in
dotnet-outdated/dotnet-outdated#671
* Show a friendly message instead of crashing when a solution has no
projects by @​DanielC000 in
dotnet-outdated/dotnet-outdated#771
* Surface package-upgrade stdout so failures are diagnosable by
@​timabell in
dotnet-outdated/dotnet-outdated#790
* Fix multiline central package version updates by @​onuracar-dev in
dotnet-outdated/dotnet-outdated#783
* Support versioned MSBuild project SDKs in project files by @​thomhurst
in dotnet-outdated/dotnet-outdated#793
* Preserve whitespace in Directory.Packages.props during upgrades by
@​symbiogenesis in
dotnet-outdated/dotnet-outdated#803
* Treat package references injected by custom SDKs as auto-referenced by
@​thomhurst in
dotnet-outdated/dotnet-outdated#795
* Preserve version ranges when upgrading packages by @​GREsau in
dotnet-outdated/dotnet-outdated#702
* Preserve MSBuild version variables across project and props files by
@​symbiogenesis in
dotnet-outdated/dotnet-outdated#805
* Replace McMaster command-line parsing with System.CommandLine by
@​slang25 in dotnet-outdated/dotnet-outdated#808
* Bump version to 4.9.0 by @​slang25 in
dotnet-outdated/dotnet-outdated#806

## New Contributors
* @​chefarbeiter made their first contribution in
dotnet-outdated/dotnet-outdated#671
* @​DanielC000 made their first contribution in
dotnet-outdated/dotnet-outdated#771
* @​timabell made their first contribution in
dotnet-outdated/dotnet-outdated#790
* @​onuracar-dev made their first contribution in
dotnet-outdated/dotnet-outdated#783
* @​thomhurst made their first contribution in
dotnet-outdated/dotnet-outdated#793
* @​GREsau made their first contribution in
dotnet-outdated/dotnet-outdated#702

**Full Changelog**:
dotnet-outdated/dotnet-outdated@v4.8.1...v4.9.0


Commits viewable in [compare
view](dotnet-outdated/dotnet-outdated@v4.8.1...v4.9.0).
</details>

Updated
[Microsoft.Extensions.Http.Resilience](https://github.com/dotnet/extensions)
from 10.11.0 to 11.0.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.Extensions.Http.Resilience's
releases](https://github.com/dotnet/extensions/releases)._

## 11.0.0

<!-- DRAFT: not published. Public baseline
f8ee27151b21e33793164b39de5bcebfdced81a4 (includes #​7923). Official
build source/tag target c60d72e7973a90cd4e4300d9153e97b93315e4b7 =
baseline + 9 internal release-prep commits (infrastructure, .NET
8/9/10/11 dependency updates, test pins, feeds, SDK 11.0.100 pin); no
additional PRs. Official build 3132207, BAR 340823, final published
manifest SHA256
A694CB054BBD836E73E2EF9EFA26FAD025EC6F709273D4CF217E08F5E1DE5CE6.
c60d72e is publicly reachable. -->
<!-- AVAILABILITY STATUS (2026-11-10): Public SDK 11.0.100 GA/download
and servicing 8.0.34/9.0.23/10.0.15 are confirmed available. Three
successful dotnet-public reads at 16:50:57Z, 17:05:36Z, and 17:20:30Z
found neither Microsoft.WindowsDesktop.App.Runtime.win-x64 8.0.34 nor
9.0.23 listed. The index samples do not establish restore, official CI,
or dependency closure. -->
<!-- VALIDATION STATUS (NOT PASSED): All 55 published package listings,
provenance/content and signatures were verified, as were 900
library/analyzer consumer graphs. The user's BAR readback confirms build
340823 in .NET 11 channel 8297. Published-source commit
c60d72e7973a90cd4e4300d9153e97b93315e4b7 is publicly reachable. All 272
selected library PDBs on msdl matched the original identities and bytes.
Website follow-up is user-deferred. -->

Version 11.0.0 ships alongside .NET 11 and with net11 targets added to
packages. Highlights of this release include new experimental Documents
and Document Extraction abstractions, metric instrument descriptions,
and a sliding-window retry budget for HTTP resilience.

## Experimental API Changes

### Now Stable
* HTTP server latency telemetry (`AddHttpServerLatencyTelemetry`) APIs
are now stable (previously `EXTEXP0013`) #​7898

### New Experimental APIs
* New experimental API: Documents abstractions in the new
`Microsoft.Extensions.Documents.Abstractions` package (`EXTEXP0019`)
#​7835
* New experimental API: Document Extraction in the new
`Microsoft.Extensions.DocumentExtraction` and
`Microsoft.Extensions.DocumentExtraction.Abstractions` packages
(`MEDE0001`) #​7588
* New experimental API: HTTP resilience retry budget
(`HttpRetryBudgetOptions`,
`HttpRetryResiliencePipelineBuilderExtensions`,
`OnRetryBudgetExhaustedArguments`) (`EXTEXP0001`) #​7867
* New experimental API: `Description` on metric attributes
(`EXTEXP0003`) #​7837

### Obsoleted APIs
* `HybridCacheOptions.DisableCompression` is now obsolete (`EXTOBS0003`)
#​7885

## What's Changed

### Telemetry and Logging

* Add Description to metric attributes and describe all instruments
#​7837 by @​evgenyfedorov2 (co-authored by @​Copilot)
* Capture trace context, thread ID and message template in buffered logs
#​7818 by @​evgenyfedorov2 (co-authored by @​Copilot)
* Allow bool and numeric types for strongly-typed metric tags #​7877 by
@​evgenyfedorov2 (co-authored by @​Copilot)
* Fix route parameter redaction when a parameter value contains a
delimiter used later in the same path segment #​7828 by @​evgenyfedorov2
(co-authored by @​Copilot)
* Fix lost log records when logging reentrantly on the same thread
#​7847 by @​evgenyfedorov2 (co-authored by @​Copilot)
* Fix logging generator stack overflow on type cycles #​7861 by
@​evgenyfedorov2 (co-authored by @​Copilot)
* Honor `[LogPropertyIgnore]` during transitive logging and
`[LogProperties(Transitive = true)]` on properties #​7868 by
@​evgenyfedorov2 (co-authored by @​Copilot)
* Make DataClassificationSet static to decrease allocations #​7874 by
@​evgenyfedorov2 (co-authored by @​Copilot)

### Caching

* Add HybridCache.GetOrCreateAsync overloads for dynamic setting of
options #​7568 by @​svick (co-authored by @​Copilot)
* Mark HybridCacheOptions.DisableCompression as obsolete #​7885 by
@​slang25
* Fix HybridCache stampede state removal race #​7814 by @​svick
(co-authored by @​Copilot)
* Fix HybridCache reservation over-release on DisableUnderlyingData miss
#​7879 by @​Eng3bbas

### AI

* AI: Restore neutral tool approval rejection message #​7913 by @​jozkee
(co-authored by @​Copilot)
* Fix ImageGenerationOptions.Clone dropping StreamingCount #​7829 by
@​Empiree
* Fix evaluation context serialization without reflection fallback
#​7869 by @​valkiara
* Pin MessagePack 2.5.307 in AI template AppHost project #​7853 by
@​evgenyfedorov2 (co-authored by @​Copilot)

### Packaging and Target Frameworks

* Condition framework-provided package references for .NET 11 #​7915 by
@​jeffhandley (co-authored by @​Copilot)
 ... (truncated)

Commits viewable in [compare
view](dotnet/extensions@v10.11.0...v11.0.0).
</details>

Updated [Microsoft.NET.Test.Sdk](https://github.com/microsoft/vstest)
from 18.11.0 to 18.12.0.

<details>
<summary>Release notes</summary>

_Sourced from [Microsoft.NET.Test.Sdk's
releases](https://github.com/microsoft/vstest/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/microsoft/vstest/commits).
</details>

Updated [System.CommandLine](https://github.com/dotnet/dotnet) from
2.0.14 to 3.0.0.

<details>
<summary>Release notes</summary>

_Sourced from [System.CommandLine's
releases](https://github.com/dotnet/dotnet/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/dotnet/dotnet/commits).
</details>

Updated [xunit.analyzers](https://github.com/xunit/xunit.analyzers) from
2.2.0 to 2.3.0.

<details>
<summary>Release notes</summary>

_Sourced from [xunit.analyzers's
releases](https://github.com/xunit/xunit.analyzers/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/xunit/xunit.analyzers/commits).
</details>

Updated [xunit.v3](https://github.com/xunit/xunit) from 4.0.2 to 4.0.3.

<details>
<summary>Release notes</summary>

_Sourced from [xunit.v3's
releases](https://github.com/xunit/xunit/releases)._

No release notes found for this version range.

Commits viewable in [compare
view](https://github.com/xunit/xunit/commits).
</details>

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions


</details>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Pieter Viljoen <ptr727@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrading packages injected by a custom project SDK fails

3 participants