25 July 2018

Build C# Project Without Visual Studio

I was recently at a computer without Visual Studio installed and was in a need of a build of a desktop C# application. Source was available on GitHub so I thought maybe since .NET comes with Windows, just maybe everything needed for successful build of a .sln is already there. Running

msbuild MySolution.sln

produced an error about missing NuGet dependencies. After downloading nuget.exe and trying again, msbuild complained about resources and missing resgen tool. Resgen regularly comes only with Visual Studio… and not installing it was the idea from the start. At this moment a thought about trying to build it online crossed my mind. After some research, Appveyor seemed the right service for this job. Signing up went fine, and connecting the GitHub project was two clicks work. Then, I started the build, everything was fine, only the output exe file was nowhere to be found.

The fix was to add an artifact with bin\debug folder.

Appveyor artifacts settings

After that, contents of output folder are available for download as zip archive.