Retrieving MSVS msbuild commandline

My apologies if this isn't the best place for this. My question isn't really about Windows Programming but I didn't know where else to ask.

I'm learning Github Actions on GitHub. Locally, I'm building successfully with MSVS 2023. One of the scripts in a Github action workflow requires the msbuild commandline parameters for my solution. The default script is:
 
msbuild /p:Configuration=Release /p:OutputPath=Release

I would like to know the actual msbuild parameters.

I have tried:
1. parsing the "detailed" output text looking for "msbuild" - but there are way too many entries - and "msbuild " - but there are none. Lower levels of detail (normal and minimal) don't include msbuild lines;
2. looking for the project's Properties > Configuration Properties > General > Property Sheet, but it's currently a console app so that section doesn't exist; and
3. executing msbuild /t:ListAvailableProperties /p:Configuration=Release in the project directory but it fails.

There may, indeed, be no further parameters but inquiring minds want to know.

Any advice on how I might be able to retrieve the commandline parameters?

Last edited on
You could try using Process Hacker or a similar tool to inspect the command-line:
https://processhacker.sourceforge.io/

(Right click on the headers area, select "Choose columns" and then activate the "Command line" column)

https://i.imgur.com/9m5tdv1.png

________

In general, something like this should work:

msbuild.exe /property:Configuration=<Name> /property:Platform=<Name> /target:Rebuild "C:\Path\to\Solution.sln"
Last edited on
Would Process Hacker actually work in this case since the command must, by definition, be internal to MSVS? Or, I suppose, a thread is created by MSVS and the command sent that way. I'll have to have a look. Seems unnecessarily complicated, though.

Your generic command line is pretty close to the default created by GitHub actions which I understand generically :-). I would like to find and insert the actual command into my workflow.
Process Hacker, or similar tool, shows you whatever command-line was passes to msbuild.exe. Not more, not less. And, as it turns out, the Visual Studio "main" (GUI) process, i.e. devenv.exe, actually launches the msbuild.exe as a separate process – so that is the point where you can easily see the command-line that was used to start the sub-process. Also see screenshot I posted above 😏

(Not sure that this command-line will be very helpful for your purpose, though, because it looks nothing like what you would use when manually invoking MSBuild; I think you are better off by sticking with the official documentation of MSBuild command-line switches!)

https://learn.microsoft.com/en-us/visualstudio/msbuild/msbuild-command-line-reference?view=vs-2022
Last edited on
I agree with your second point and believe this is probably the only way to achieve what I need for GitHub. More experimentation will be required, unfortunately.
Topic archived. No new replies allowed.