Skip to content

Update MVC F# project template to resolve deprecated warnings - #69114

Open
Youssef1313 with Copilot wants to merge 2 commits into
release/11.0from
copilot/update-project-template
Open

Update MVC F# project template to resolve deprecated warnings#69114
Youssef1313 with Copilot wants to merge 2 commits into
release/11.0from
copilot/update-project-template

Conversation

Copilot AI commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Update MVC F# project template to resolve deprecated warnings

This is a follow-up to #68841.

We obsoleted all overloads of AddRazorRuntimeCompilation, but we missed one use in template code for F#.

Description

We missed a use of an obsolete API in F# template. This PR updates the template to drop the obsolete call.

Fixes #69113

Customer Impact

Template output today compiles with a warning. We want customers to have clean builds when creating a new project from templates.

Regression?

Yes, from #68841. The template used to compile cleanly without any warnings. Now it does have a warning.

Risk

Low.

This is a template change only and removes a call to an obsolete API.

Verification

A template test added. Ideally, we should enhance our tests in the future to actually build the project and ensure that it has no warnings. This hasn't been done as part of this PR though.

Packaging changes reviewed?

N/A

Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
@Youssef1313
Youssef1313 marked this pull request as ready for review September 8, 2026 09:45
Copilot AI lite review requested due to automatic review settings September 8, 2026 09:45
@Youssef1313 Youssef1313 added the Servicing-consider Shiproom approval is required for the issue label Sep 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @copilot. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge.

To learn more about how to prepare a servicing PR click here.

@Youssef1313 Youssef1313 changed the title [WIP] Update MVC F# project template to resolve deprecated warnings Update MVC F# project template to resolve deprecated warnings Sep 8, 2026

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.

🟢 Approval recommended

The changes cleanly remove the deprecated runtime compilation usage, and the updated template tests validate the absence of the package/API in generated output.

Pull request overview

This PR updates the MVC F# project template to match the C# template by removing Razor runtime compilation usage, eliminating the FS0044 deprecation warning introduced by the obsolete runtime-compilation API/package.

Changes:

  • Removed the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package reference from the F# MVC template project file.
  • Removed the .AddRazorRuntimeCompilation() call from the F# template’s Program.fs.
  • Updated MVC template tests to ensure runtime compilation is not emitted in generated projects and added an F#-specific assertion for Program.fs.
File summaries
File Description
src/ProjectTemplates/Web.ProjectTemplates/StarterWeb-FSharp.fsproj.in Removes the runtime compilation package reference from the F# MVC template project.
src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj Removes the now-unused runtime compilation version/property wiring from template pack generation.
src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Program.fs Removes the obsolete runtime compilation service registration to avoid FS0044.
src/ProjectTemplates/test/Templates.Mvc.Tests/MvcTemplateTest.cs Adds coverage to ensure runtime compilation isn’t present in generated MVC projects (and specifically not called in F#).
Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@Youssef1313
Youssef1313 requested a review from artl93 September 8, 2026 09:51

@artl93 artl93 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.

We should ship clean templates. Approved.

@artl93 artl93 added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 8, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @copilot. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MVC F# project build with warning "FS0044: This construct is deprecated", should update the project template.

5 participants