Skip to content

F# WriteCodeFragment rejects positional literal metadata #20550

Description

@Evangelink

Please provide a succinct description of the issue.

FSharp.Build's WriteCodeFragment treats every metadata key beginning with _Parameter as a positional parameter. Standard MSBuild assembly-attribute generation uses companion metadata such as _Parameter1_IsLiteral, which FSharp.Build incorrectly parses as a positional index.

Repro steps

Provide the steps required to reproduce the problem:

  1. Add an AssemblyAttribute item with _Parameter1 and _Parameter1_IsLiteral=true metadata. MSTest's MSTestParallelizeScope and MSTestParallelizeWorkers properties generate this shape.
  2. Build an F# project with generated assembly information enabled.

If possible attach a zip file with the repro case. This often makes it easier for others to reproduce.
The zip file should ideally represent the situation just before the call/step that is problematic.

N/A

Expected behavior

_Parameter1_IsLiteral marks _Parameter1 as literal code, and FSharp.Build generates the requested assembly attribute.

Actual behavior

The build fails with Unable to parse '1_IsLiteral' as an index.

Known workarounds

Declare the assembly attribute in an F# source file instead of using the MSBuild assembly-attribute properties.

Related information

  • Operating system: all
  • .NET Runtime kind: all SDK-style F# projects
  • Editing Tools: N/A

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ProjectsAndBuildMSBuild tasks, project files, framework resolution

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions