Sevin7
Sevin7

Reputation: 6492

.net max class size

Is there a limitation (perhaps a compiler limitation) on the size of a class in ASP.NET 3.5?

I have a single class file that is going to keep growing and could become quite large (easily 100k lines of code, or 10k members).

I simply need to know if there is a limit on lines of code, or raw file size, or quantity of members in a single class.

Please do not ask why I'm doing something that sounds both stupid and crazy; I'm well aware of the consequences of such an approach.

Upvotes: 1

Views: 2458

Answers (2)

Pace
Pace

Reputation: 43817

FWIW, I had a file with 165k lines of code (~6MB) that I had generated with a tool of mine (it was meant to load some test data).

On Linux (Ubuntu 16.04) I received a System.AccessViolationException when I attempted to use the type in the file.

So it would seem there is indeed some limit.

I should mention this was using .NET Core 2.0

Upvotes: 0

Didac Perez Parera
Didac Perez Parera

Reputation: 3814

Absolutely not, there is not a max size of a class.

Upvotes: 2

Related Questions