开发者

one DLL, multiple projects?

开发者 https://www.devze.com 2022-12-15 20:31 出处:网络
Is it p开发者_JAVA技巧ossible 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 possible but I no

Is it p开发者_JAVA技巧ossible 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 possible but I notice that's a post from 2004. I'm using Visual Studio 2008 Team System and it's a C# application.


No. Each project will compile into a separate library or application.

You can, however, merge these together into a single DLL or EXE file using ILMerge post compilation.


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.


It is possible, and it was even possible in 2004.

However, Visual Studio does not expose it.

You need to use netmodules.


You could create an MSBuild script that uses XSLT to combine all of the csproj files into one and then builds it. You won't need to copy cs files or anything like that, just dynamically generate a new csproj file.


Never done it personally but looks like this tool could make that happen:

ILMerge

0

精彩评论

暂无评论...
验证码 换一张
取 消