Max .net class size

Is there a restriction (possibly a compiler restriction) on class size in ASP.NET 3.5?

I have one class file that will continue to grow and can become quite large (easily 100k lines of code or 10k members).

I just need to know if there is a limit on lines of code or the size of a raw file or the number of members in one class.

Please do not ask why I am doing what sounds so stupid and insane; I am well aware of the consequences of this approach.

+1
source share
2 answers

Absolutely not, the maximum class size is small.

0
source

FWIW, I had a file with 165k lines of code (~ 6 MB) that I created using my tool (it was intended to load some test data).

On Linux (Ubuntu 16.04), I got a System.AccessViolationException when I tried to use this type in a file.

Thus, it would seem that there is indeed some limit.

I should mention that it used .NET Core 2.0

0
source

Source: https://habr.com/ru/post/1241975/


All Articles