Frage

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.

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top