Skip to content

Setting ProvideCommandLineArgs to the Csc/Vbc task includes non-Csc args  #67102

@jasonmalinowski

Description

@jasonmalinowski

ProvideCommandLineArgs is a switch on the Csc/Vbc build tasks which lets the task produce as an output the arguments that will be passed to Csc. It doesn't quite work right however in .NET Core: since the tool task in that case doesn't invoke csc.exe but instead tries to invoke "dotnet.exe exec csc.dll"..., the "exec" and "csc.dll" also appear in the ProvideCommandLineArgs. This throws off project systems since we then take the command line args and pass them to the command like parser, so logically you have a source file named "exec"... 😄

Steps to Reproduce:

  1. Create a new dotnet console app project.
  2. Add <ProvideCommandLineArgs>true</ProvideCommandLineArgs>
  3. dotnet build -bl
  4. Look at the output items of the Csc task:

image

In this case, we'd expect the CscCommandLineArgs are just the parts going to csc, excluding the parts going to dotnet.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions