AArnott / CodeGeneration.Roslyn

Assists in performing Roslyn-based code generation during a build.
Microsoft Public License
408 stars 59 forks source link

command line arguments during build are too long #56

Closed dasMulli closed 6 years ago

dasMulli commented 6 years ago

Consider using a response file instead of generating a large command.

Referencing an asp.net core app already breaks the by causing an

C:\Users\martin.ullrich\.nuget\packages\codegeneration.roslyn.buildtime\0.4.11\build\CodeGeneration.Roslyn.BuildTime.targets(20,5): error MSB6003: The specified task executable "dotnet" could not be run. The filename or extension is too long 

The command-line for the "GenerateCodeFromAttributes" task is too long. Command-lines longer than 32000 characters are likely to fail. Try reducing the length of the command-line by breaking down the call to "GenerateCodeFromAttributes" into multiple calls with fewer parameters per call.
dasMulli commented 6 years ago

@AArnott I've created a replacement msbuild target to work around this (it creates a response file and reads the output file). do you think it is better to keep the msbuild task dll around or maybe migrate to pure msbuild?

AArnott commented 6 years ago

Thanks for the report and diagnoses. I'm inclined to keep the MSBuild task around. Mostly in the hopes of one day MSBuild actually supporting doing all this in-proc so I don't have to spawn dotnet.exe.