Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WriteCodeFragment should support IsLiteral suffix for parity with MSBuild #18084

Open
Youssef1313 opened this issue Nov 29, 2024 · 2 comments
Open
Labels
Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution Feature Request
Milestone

Comments

@Youssef1313
Copy link
Member

See dotnet/msbuild#9724 for the original bug report.

MSBuild PR that implemented the feature for C#/VB in the past: dotnet/msbuild#6285

See https://learn.microsoft.com/en-us/visualstudio/msbuild/writecodefragment-task for documentation for IsLiteral. (NOTE: The doc page says it's not supported by F# and will need to be updated when/if this is implemented)

cc @Evangelink

@T-Gro
Copy link
Member

T-Gro commented Dec 10, 2024

Hi @Youssef1313 , could you please provide a code snippet which would show where this is useful (= and where this is being a paint point as of today) ?

Do I understand it correct that this is to overcome attributes which are not covering their inputs via constructor arguments, and only provide setter properties?

@Youssef1313
Copy link
Member Author

Hi @T-Gro

Code snippet:

<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>

That works fine today with C#/VB, but no with F#.

And yes, this is for named attribute arguments (i.e, property setters).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ProjectsAndBuild MSBuild tasks, project files, framework resolution Feature Request
Projects
Status: New
Development

No branches or pull requests

3 participants