I ran into this issue today when experimenting with the security capabilities in SQL Server 2012 Master Data Services. I am working with a very large Product data model for a Manufacturing client. The core entity has 391 attributes at this point in time. I was attempting to understand how I can secure this entity such that users responsible for mass updating a set of attributes can refine their view only to those attributes.
In the prior version of MDS (SQL Server 2008 R2), Attribute Groups were the solution to this problem. In 2012, it would seem that Attribute Groups are not secured in the same way. But that is a topic for another time.
When I attempted to set a Deny permission on a single attribute in the model, I received a generic error in the Web Application interface: An Unknown Error has occurred. When I turned on the Trace in web.config (located under C:\Program Files\SQL Server\110\Master Data Services\WebApplication), saw the following error:
MDS Error: 0 : LogError : Operation is not valid due to the current state of the object.
StackOverflow to the rescue! This error is apparently a common one in ASP.NET web applications where large collections are being serialized. By adding an appSettings key to the web.config, I was able to increase the limit of collection keys/members:
<appSettings> <add key=”aspnet:MaxHttpCollectionKeys” value=”2001″ /> </appSettings>
And that solved the problem!