سؤال

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.

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top