How to compile C# class library project with mono (linux)?

1.8k Views Asked by At

Using C# compiler, in Windows I can successfully create a .dll file from a C# project, using the following commands:

cd /path/to/my/directory/with/.csproj/file
csc /target:library /out:NameOfNewDll.dll /recurse:*.cs

But, I need to do the same with the MSYS2 Linux environment, where I already have access to mono and msc and csc commands. My project is actually a class library project, with many classes (so it's not classical application with an entry point).

What I am trying to do is:

mcs /path/to/my/directory/with/.csproj/file/*.cs /target:library /out:NameOfNewDll.dll /recurse:*.cs

But it's not working. I can not compile class by class since they all have references one to another and I need one general .dll file that will represent my whole class library project. I read somewhere about xbuild, but as I understood this is now deprecated tool.

0

There are 0 best solutions below