I want to run MSBuild on a users PC as part of a WinForms ClickOnce deployment. That is after the application is downloaded and run (via clickonce) the application needs to kick off an MsBuild to handle database updates (using MigratorDotNet).
Q - How can my application robustly kick off MsBuild? i.e. how can it be sure what path it is installed, what if it is not installed, should I be including the MSBuild.exe in the clickonce package so that I know it is there for sure myself?
You can look at the values for
MSBuildToolsPath
underBut with ClickOnce I don't think you will be able to execute MSBuild scripts.
I don't think you are allowed to redistribute MSBuild. Since MSBuild is distributed with the .NET Framework you can just check to see if v2+ is installed. If not then you can prompt them to install it.