From Can I build 2 or more dlls from C# project in Visual Studio 2008?, I have another idea to create only 1 big project. After that, I separate a project dll(that contains many classes.) into 1 dll per class by using post-build event to call Win app project(for separate a big dll). How to do this?
Moreover, I need to manage attached file in a big dll too.
Update I found some trick that could guide me to solve this problem by custom build? Moreover, I think I can create custom handler that generate dynamic assembly file by using separate module file & al.exe. But this feature is over my expect and unnessary(sourcecode is rarely changed).
Multi-file Assemblies: What and How
How to: Build a Multifile Assembly
POCO Custom Multifile Assembly and ReSharper
Thanks,
Just... why? Having lots of dlls can have a performance impact on app startup (due to "fusion"). It will also pretty-much immediately suffer from circular references, which is a bad thing.
Since .NET code (by default) gets JITted when first used, there isn't a huge amount of impact in having extra classes in a dll that don't get used in that application. They just sit there, quietly, being no bother to anyone.
The sheer management cost of having a dll per class will make deployment etc excruciating.
All in all, I can't think of a sensible reason to do this...
This problem is solved by custom script for MSBuild that was explained in another question.
Visual studio one project with several dlls as output?
Thanks @franko_camron for suggestion.
The answer that you will get here is no different from the answer in the other question: put in a separate project for each separate dll.
What I want to ask you is what your understanding of the definition of a "class" is. One class per DLL probably means that you're not very familiar with how assemblies, namespaces, and classes work.
Tell us, what do you really want to be able to do? Because what you think you should be doing to solve that problem (e.g., creating one DLL per class) is not practical.
Update
Considering the context of your requirement (e.g., Silverlight web application), my conclusion is that splitting your classes to several DLLs will not result in a performance improvement in an ASP.NET web page because:
So with your requirements, it's probably best NOT to use Silverlight for your application, considering the bandwidth limit. The avenues you can explore are: