one DLL, multiple projects?

前端 未结 5 2128
难免孤独
难免孤独 2020-12-29 10:35

Is it possible to force my C# solution file to make a single DLL containing all the projects in the solution, instead of one DLL per project? This dude says that isn\'t pos

5条回答
  •  臣服心动
    2020-12-29 11:06

    It is not possible with Visual Studio directly, but you can merge assemblies using ILMerge. This could e.g. be done in a post-build step:

    ilmerge /target:winexe /out:SelfContainedProgram.exe 
        Program.exe ClassLibrary1.dll ClassLibrary2.dll
    

    If your project is an ASP.Net project you can rely on the ASP.NET Merge Tool.

提交回复
热议问题