1

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.

delux
  • 1,694
  • 10
  • 33
  • 64
  • If you have .NET Core CLI(SDK) package, you can build a csproj in Linux systems. https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-build –  Jul 31 '20 at 09:24
  • _"Linux environment...My project is actually a class library ... (so it's not classical application with an entry point)."_ - Strangely enough, Windows developers are also known to create class libraries ;) –  Jul 31 '20 at 09:29

0 Answers0