Update MVC F# project template to resolve deprecated warnings - #69114
Update MVC F# project template to resolve deprecated warnings#69114Youssef1313 with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
|
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. |
There was a problem hiding this comment.
🟢 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.RuntimeCompilationpackage reference from the F# MVC template project file. - Removed the
.AddRazorRuntimeCompilation()call from the F# template’sProgram.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.
artl93
left a comment
There was a problem hiding this comment.
We should ship clean templates. Approved.
|
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. |
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