title: How to compile C# class library project with mono (linux)?
body: <p>Using <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/command-line-building-with-csc-exe" rel="nofollow noreferrer">C# compiler</a>, in Windows I can successfully create a <code>.dll</code> file from a <code>C# project</code>, using the following commands:</p>
  <pre><code>cd /path/to/my/directory/with/.csproj/file
  csc /target:library /out:NameOfNewDll.dll /recurse:*.cs
  </code></pre>
  <p>But, I need to do the same with the <code>MSYS2</code> Linux environment, where I already have access to <a href="https://www.mono-project.com/docs/getting-started/mono-basics/" rel="nofollow noreferrer">mono</a> and <code>msc</code> and <code>csc</code> commands. My project is actually a class library project, with many classes (so it's not classical application with an entry point).</p>
  <p>What I am trying to do is:</p>
  <pre><code>mcs /path/to/my/directory/with/.csproj/file/*.cs /target:library /out:NameOfNewDll.dll /recurse:*.cs
  </code></pre>
  <p>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 <code>.dll</code> file that will represent my whole class library project.
  I read somewhere about xbuild, but as I understood this is now deprecated tool.</p>