I am working on a deployer application that publishes (builds and creates the output) of C# projects and does other works.
MSBuild is not handy. So, I thought about creating my own build engine.
I know it's possible to use C# compiler to compile a simple sample.cs file into a dll file. But can I compile a project entirely without MSBuild?
Yes, you can use csc
(the C# compiler) all the way to compile your source code. The problem is you have to everything yourself.
Since MSBuild can interpret sln
and csproj
files, and understands the various actions to be taken, the references to use and where to find them, it is much easier to use than csc
. For example: there are some Tasks specific for Office add-ins. MSBuild knows how to execute them from their remote target files. You don't, so if you want to use those, you need to do all actions yourself. It is possible, just a little hard if you want to compile very complex projects.
It might help to use Roslyn to set up your compile statements and actually compile your code. You still need a way to specify all parameters.
As it's mentioned in this answer, you can use other build engines to see if they fit your needs or not. Two of them are Microsoft.Build, and Make for Windows
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With