Visitar URL original
Add .NET file-based app support by DamianEdwards · Pull Request #752 · dotnet-outdated/dotnet-outdated · GitHub
Skip to content

Add .NET file-based app support - #752

Merged
slang25 merged 4 commits into
dotnet-outdated:masterfrom
DamianEdwards:damianedwards/fba-support-investigation
May 29, 2026
Merged

slang25 merged 4 commits into
dotnet-outdated:masterfrom
DamianEdwards:damianedwards/fba-support-investigation

Conversation

@DamianEdwards

Copy link
Copy Markdown
Contributor

Summary

  • Add support for targeting .NET file-based apps via .cs paths
  • Generate restore graphs for file-based apps and map virtual SDK project paths back to source files
  • Update #:package directives, including variable-backed versions through #:property
  • Add opt-in recursive loose FBA discovery via --include-file-based-apps / -fba
  • Document FBA behavior and add tests for discovery, graph generation, variable tracking, package updates, and SDK-backed FBA end-to-end coverage
  • Add explicit CI coverage for file-based apps with .NET SDK 10.0.300 on Ubuntu, Windows, and macOS

Validation

  • dotnet test --configuration Release
  • dotnet test --configuration Release --framework net9.0 --filter "FullyQualifiedName~File_Based_App"
  • dotnet run --configuration Release --framework net9.0 --project src\DotNetOutdated -- test-projects\file-based-app\app.cs --fail-on-updates
  • Fork PR checks: 9/9 passing, including explicit .NET SDK 10.0.300 file-based app jobs on Ubuntu, Windows, and macOS

DamianEdwards and others added 4 commits May 29, 2026 12:51
Support .NET file-based app paths throughout discovery, restore graph generation, analysis, reporting, and package updates.

Add opt-in recursive discovery for loose shebang .cs file-based apps while preserving the fast project-only recursive path by default.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

Pull request overview

Adds support for analyzing and upgrading .NET file-based apps (.cs script files with #:package/#:property directives), including discovery, dependency graph generation via dotnet restore+dotnet build /t:GenerateRestoreGraphFile, mapping graph results back to the source .cs path, variable-backed package directive updates, and CI coverage on .NET SDK 10.0.300.

Changes:

  • New ProjectPathExtensions and updated discovery/analysis services to accept .cs paths and recursively discover loose shebang FBAs (gated behind --include-file-based-apps/-fba), excluding .cs files inside a .csproj cone.
  • VariableTrackingService extended to parse #:property definitions, resolve $(...) expressions in #:package directives, and update version variables in-place while preserving variable references; DotNetPackageService short-circuits FBA variable updates and runs dotnet restore <file> instead of dotnet add package.
  • New tests, fixtures, README documentation, and a dedicated cross-platform CI job (file-based-app) that requires SDK 10.0.300.

Reviewed changes

Copilot reviewed 20 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/DotNetOutdated.Core/ProjectPathExtensions.cs New helpers IsCSharpFile/IsCSharpProjectFile/IsProjectFile/IsSolutionFile
src/DotNetOutdated.Core/Services/IProjectDiscoveryService.cs Adds includeFileBasedApps parameter
src/DotNetOutdated.Core/Services/ProjectDiscoveryService.cs Recursive FBA discovery with shebang and project-cone logic; accepts .cs direct paths
src/DotNetOutdated.Core/Services/DependencyGraphService.cs New restore+build path for FBAs; differentiated error message
src/DotNetOutdated.Core/Services/ProjectAnalysisService.cs Maps FBA graph results back to original .cs path/name
src/DotNetOutdated.Core/Services/DotNetPackageService.cs Short-circuit for FBA variable directives; new RestoreProject helper
src/DotNetOutdated.Core/Services/VariableTrackingService.cs Parses #:property/#:package; updates property + preserves variable refs; cache invalidation refactor
src/DotNetOutdated.Core/Resources/ValidationErrorMessages.{resx,Designer.cs} Updated messages mention file-based apps
src/DotNetOutdated/Program.cs Adds -fba option, passes through to discovery; uses GetShortFolderName() for upgrade
src/DotNetOutdated/ProjectExtensions.cs Treats .cs as SDK-style project
src/DotNetOutdated/McpServer.cs MCP descriptions/schema updated; handles includeFileBasedApps
README.md Documents .cs paths, -fba, SDK 10.0.300 requirement, FAQ note
.github/workflows/test.yml New file-based-app cross-platform job with SDK 10.0.300
test/DotNetOutdated.Tests/* New tests for discovery, graph generation, variable tracking, package updates, and E2E (gated on SDK 10.0.300)
test-projects/file-based-app{,-direct-package}/app.cs Test fixtures for variable-backed and direct #:package directives
Files not reviewed (1)
  • src/DotNetOutdated.Core/Resources/ValidationErrorMessages.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@slang25

slang25 commented May 29, 2026

Copy link
Copy Markdown
Member

Thanks for this @DamianEdwards
A really nice addition 😁

@slang25
slang25 merged commit 7d09478 into dotnet-outdated:master May 29, 2026
9 checks passed
@slang25 slang25 mentioned this pull request May 30, 2026
slang25 added a commit that referenced this pull request May 30, 2026
Minor release: adds .NET file-based app support (#752).

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
slang25 added a commit to GREsau/dotnet-outdated that referenced this pull request Nov 8, 2026
Resolves conflicts with variable tracking (dotnet-outdated#714), the CPM --no-restore
direct write (dotnet-outdated#713), file-based apps (dotnet-outdated#752/dotnet-outdated#755) and short TFM names (dotnet-outdated#750).
AddPackage now takes the VersionRange through all of master's new paths;
single-version paths use the range's lower bound for now (refined in
follow-up commits). Restores the System.Text.Json using needed by master's
tests and adapts DotNetPackageServiceTests to the new signature.

Co-Authored-By: Claude Opus 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.

3 participants