简体   繁体   中英

How to create a java interface to compile c# code, and then generate dll's?

I would like to start coding a java interface but I want that The internal funcionality is to generate dll's from c# codes, I have several projects which several c# classes...

Basically the idea is to make a setup, so there would be a .zip or .rar wich will contain all c# projects and a java exe which, when executed, will compile c# projects and then place the dll's in a specific directory,

Do you know any example of how to do this?

You can use MSBuild to build .NET projects from the command line, which I think would be easy for you to call from Java code (though I don't understand why you are trying to use a Java program to trigger a compilation).

Read about MSBuild here: http://msdn.microsoft.com/en-us/library/ms171452%28v=vs.90%29.aspx

If you mentioned Portability ,than i think you need to run that java App. also at Linux and Mac ,so instead of MSBuild which work's only at Windows ,you can try http://www.mono-project.com/CSharp_Compiler Mono Compiler which is Cross Platform .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM