I am using .net cli 2.0.3 and I was wondering if it is possible to load my arguments from file i.e.
dotnet publish -args somefile
Where somefile will contain the arguments which the certain command accepts.
For example, while publishing I want to have predefined path\project.csproj -c Release -o "outputpath"
I know that there isn't that kind of command in the sdk, but is there a way that I can achieve it ?
Best regards!
While the CLI itself doesn't have a mechanism to load response files, it calls out to MSBuild which does support both specified response files and the following automatic response files:
MSBuild.rspnext to the project / solution file to buildDirectory.Build.rspin the hierarchy at or above the project / solution file to buildWhile you cannot specify CLI arguments, you can specify their equivalent MSBuild arguments.
For example you can create a
release.rspnext to your solution file that specifies:Which you could use to call
If the same file was named
Directory.Build.rsp, it would have been applied automatically. If would also have been applied autoamatically if it was namedMSbuild.rspand put it next to the csproj file.