Question

For example: can I create a "Hello World" console application from another C# application and build it?

I want to create a simple automated process that creates .NET projects without Visual Studio and build them.

Was it helpful?

Solution

All you really need to do is have your program create a .cs source file with the source you want and run it through the command line compiler.

csc.exe (Microsoft's compiler)

Mono's compiler

You can also use CodeDom to access the C# compiler from code.

If you absolutely must have an entire .NET project, make a minimal .csproj file and use that as a template. You can build them with msbuild or XBuild.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top