Skip to content

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

Closed

Description

@jinzhao1127

REGRESSION INFO: Works well on 11.0 RC 1

INSTALL STEPS:

  1. Clean Win11 x64 25h2 ENU
  2. Install the .NET 11.0 RC 2 SDK: https://aka.ms/dotnet/11.0.1xx/daily/dotnet-sdk-win-x64.exe
  3. Add feed

Platform

  • Windows
  • macOS
  • Linux

Repro Steps

  1. Open a normal Command Prompt
  2. Create a MVC F# proejct and build it
    dotnet new mvc -lang F# -o MVCFS
    cd MVCFS
    dotnet build
    

Actual Result
There is a warning FS0044: This construct is deprecated
Image

Log:

 C:\Users\v-zhajin\MVCFS\Program.fs(29,14): warning FS0044: This construct is deprecated. 
Razor runtime compilation is obsolete and is not recommended for production scenarios. 
For production scenarios, use the default build time compilation. For development scenarios, use Hot Reload instead. 
For more information, visit https://aka.ms/aspnet/deprecate/003.

Note

  1. This issue related with Mark AddRazorRuntimeCompilation methods obsolete #68841 change
  2. The MVC FS template should update.
  3. This issue does not repro on MVC C# project

Activity

  1. added
    area-mvc
    on Sep 8, 2026
  2. jinzhao1127 commented on Sep 8, 2026

    @jinzhao1127
    Author

    @Youssef1313 , could you take a look?

  3. MihuBot commented on Sep 8, 2026

    @MihuBot
  4. added this to the 11.0-rc2 milestone on Sep 8, 2026
  5. added theissue type on Sep 8, 2026
  6. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    Triage Summary

    Area: area-mvc (F# MVC project template build warning, already labeled)
    Type: Bug (F# template emits an unintended deprecation warning after a related change; does not repro in the equivalent C# template)

    Regression Info

    • Previously working version: .NET 11.0 RC 1
    • Broken since: .NET 11.0 RC 2
    • The F# MVC template (dotnet new mvc -lang F#) now emits FS0044: This construct is deprecated referencing Razor runtime compilation obsoletion, which did not occur in RC 1. The reporter links this to Mark AddRazorRuntimeCompilation methods obsolete #68841. The C# MVC template does not exhibit the warning.

    Potential Duplicates

    • None found

    Generated by Issue Triage Agent for dotnet/aspnetcore for #69113 · copilot · auto · 53.4 AIC · ⌖ 19.4 AIC · ⊞ 29.6K · ◷

  7. jinzhao1127 commented on Sep 11, 2026

    @jinzhao1127
    Author

    Verify this bug on the latest .NET 11 RC2[11.0.100-rc.2.26460.105 ], it was fixed now. But found a new issue #69220 due this change

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

Metadata

Metadata

Labels

area-mvc

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions