Skip to content

mvc F# template: conditions defined in the templates are not correct #44729

@vlada-shubina

Description

@vlada-shubina

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:


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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Attention 👋This issue needs the attention of a contributor, typically because the OP has provided an update.feature-templatesold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions