how to eliminate dependencies with mcs (mono) comm

2019-09-09 09:54发布

问题:

I use the following command for mono in bash (to compile a C# program)

mcs -t:library -r:nunit.framework.dll *.cs

it works and I have my Program.dll. However, when I try to use the dll (with NUnit for example) if I don't have the nunit.framework.dll in the same folder, it doesn't work. Is it possible for the Program.dll to "have in it" the nunit.framework.dll so I only have one file to move around?

How do I tell the msc command to do this?

回答1:

This is not possible using mcs but you can use ILRepack.exe to merge the assemblies into one file.

ILRepack.exe [options] /out:<path> <path_to_primary> [<other_assemblies> ...]


标签: c# bash mono