-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
mvc
F# template: conditions defined in the templates are not correct.
I accidentally found out that conditions defined in F# mvc
template are not correct.
Example of incorrect conditions:
aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Program.fs
Line 13 in 1e8fe7e
#if !NoHttps |
aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-FSharp/Program.fs
Line 39 in 1e8fe7e
#if HasHttpsProfile |
F# files (same as C# files) use C++ condition evaluator, which requires the condition to be in brackets.
If the template is run in Debug
mode, it will fall to exception.
In release mode, the condition is attempted to be evaluated anyway, and it works (likely accidentally), so it lowers the priority.
Conditions in C# files are correct.
Expected Behavior
Use #if (HasHttpsProfile)
syntax for conditions in F# files, similar to C# files.
Steps To Reproduce
Run dotnet new mvc --language F#
template in Debug mode of dotnet sdk.
Exceptions (if any)
No response
.NET Version
.NET 6, NET 7
Anything else?
No response