Skip to content

[Bug]: WriteCodeFragment - assembly attribute doesn't work for F# #9724

Closed
@Evangelink

Description

@Evangelink

Issue Description

Not sure if that's by-design and the doc is only missing some sections or if that's a bug.

As part of maintenance on test-templates, I am trying to enable parallelize assembly attribute by default using the <AssemblyAttribute.../> syntax in the project. I have been able to successfully provide the implementation for C# and VB.NET but F# is failing with Unable to parse '1_IsLiteral' as an index.

Steps to Reproduce

  • Create a new F# MSTest project: dotnet new mstest --language F#

  • Edit the fsproj by adding:

<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.Parallelize">
  <_Parameter1>Workers = 0</_Parameter1>
  <_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
  <_Parameter2>Scope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.MethodLevel</_Parameter2>
  <_Parameter2_IsLiteral>true</_Parameter2_IsLiteral>
</AssemblyAttribute>
  • Build: dotnet build

Error:

<redacted>\FSharp\Microsoft.FSharp.Overrides.NetSdk.targets(30,5): error : Unable to parse '1_IsLiteral' as an index [<redacted>\
project.fsproj]

Expected Behavior

Feature is supported or doc and error is improved to specify this is not supported.

Actual Behavior

<AssemblyAttribute.../> syntax in the project. I have been able to successfully provide the implementation for C# and VB.NET but F# is failing with Unable to parse '1_IsLiteral' as an index.

Analysis

No response

Versions & Configurations

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageHave yet to determine what bucket this goes in.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions