0

I have a project (C# Framework 4.6.1) with a properties class. Its just like project.settings. Looks like this:

enter image description here

It has about 225 +- settings. If I add 1 single additional simple setting (just a string, not a duplicate), it causes the project to not compile. Shows errors like this:

enter image description here

Stating that it cannot find the property.
The only thing I can think of is we have reached a limit in the number of settings.
Does anyone have help here?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Glen Herman
  • 123
  • 2
  • 9
  • If you comment out another of your properties, does this one work? – Flydog57 Aug 28 '20 at 18:41
  • i havent encountered any such limit yet, can you upload this class to somewhere. as far as my knowledge goes, your limit is your memory size. 225 is nothing. – Alok Aug 28 '20 at 18:41
  • also a word of advice, we keep our settings in json (encrypted/plain as required) files, and load it dynamically whenever/wherever its needed. and we handle big e-commerce with ~1000 of rules. maybe you can use the similar approach? – Alok Aug 28 '20 at 18:44
  • as for the limit part maybe this answer can help https://stackoverflow.com/questions/6306792/any-limit-to-number-of-properties-on-a-net-class#:~:text=2%20Answers&text=The%20metadata%20can%20have%20up,1%20for%20the%20entire%20assembly. – Alok Aug 28 '20 at 18:45

1 Answers1

0

The Upper limit for number of properties in a c# class 1 << 23 - 1.

more info you can get from this old SO answer Any limit to number of properties on a .NET Class?

so basically, as per your project scope you havent reached that limits yet and the problem lies in somewhere else in code, it would be great if you can share the property class on git or somwhere else we can mock and test.

Alok
  • 808
  • 13
  • 40