Is there a class per dll limit in asp.net?
Is there a limit to how many clas开发者_C百科ses can be contained inside of a dll in an asp.net application?
Not sure what the question is? Classes are definitions that get compiled into the DLL that your projects can reference, I don't think there is a limit as to the number of classes....
HTH.
It depends on what you are trying to do.
By default, all of your ASP.Net code will compile into a single DLL, which is typically named after the application in question.
However, if you need multiple classes to provide support for your data access layer, or custom objects, your best bet is to create a solution in Visual Studio with multiple projects. A class library for your data access layer, and a class library for each of your custom objects.
From there you can simply add a reference to each of your custom libraries from within your ASP.Net application and the web application will pull in the updated DLLs as needed.
There is no documented limit that I've seen for the number of classes a DLL can contain. My guess would be that there is a point where you might have so many classes in a DLL that some operations would be slow or may crash due to out of memory or stack overflow exceptions. Such things as reflection that might try to iterate or traverse the classes. You would probably need thousands upon thousands of classes before this would occur though.
精彩评论