0

We have a build server that has only the MSBuild 16 (VS buildtools 2019) installed without the Visual Studio.

We are not able to publish any project even the build completed successfully. PS: the command line is correct and our poject is built and published properly on a dev machine where the Visual Studio is installed.

Is it mandatory to have the Visual Studio installed on the build server?

Thanks in Advance.

Thorn
  • 1
  • 2
  • Yes it seems. Read this: https://github.com/Microsoft/msbuild/blob/master/documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md – Shiham Sep 21 '19 at 14:09
  • How does the [logging](https://learn.microsoft.com/en-us/visualstudio/msbuild/obtaining-build-logs-with-msbuild?view=vs-2019) differ between the two scenarios? Try various verbosity settings. Use a log file parameters if that helps. – Tom Blodget Sep 22 '19 at 00:58
  • Already tried that, in the build machine the build log shows that it has skipped the publishing section unlike the dev machine. – Thorn Sep 22 '19 at 11:40

1 Answers1

1

Is it mandatory to have the Visual Studio installed on the build server?

It's not necessary. Msbuild package only is enough for your requirement when you're building and publishing in server.

1.Please try using command like msbuild xx.sln(or xx.csproj) /t:rebuild to check if there's any extra info from the build process.

(Make sure you're installed required corresponding SDK, .net core or .net framework...)

2.Since you're using msbuild for VS2019, please check if you have a Web folder in path C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VisualStudio\v16.0.

The publish-related targets file and assemblies are under that folder. So if you can build but can't publish, the files in it may be missing or broken in your server.

If the Web folder not exists, please make sure you've installed this workload:

enter image description here

If the Web folder exists and your project targets .net core instead of .net framework, please also try installing this workload:

After that check if the issue goes away. You may also need to repair the build tools package if something is broken. More details about how to install the corresponding workload by UI or command-line see here.

enter image description here

LoLance
  • 25,666
  • 1
  • 39
  • 73
  • It's worth noting that I did have the Web folder already but didn't have the `Web development build tools` as part of the MSBuild tools install. Installing that sorted it for me. – Richard Ockerby Jun 16 '20 at 16:05