Raghu's SharePoint Corner: Parser Error: Direct Dependencies and The Limit Has Been Exceeded

My blog has moved!

You will be automatically redirected to the new address. If that does not occur, visit
http://www.sharepointcolumn.com
and update your bookmarks.

June 27, 2008

Parser Error: Direct Dependencies and The Limit Has Been Exceeded

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.





Parser Error Message: The page '/sites/blah/_catalogs/masterpage/blah.master' allows a limit of 11 direct dependencies, and that limit has been exceeded.

During deploying user control on the master page, in one of our project I used to get the above error. Generally such kind of exception is thrown will rendering a page. The reason behind this is the number of controls allowed on the page to render exceeds the limit specified in the web.config file



The solution of this problem can be fixed in two different ways.
Solution 1: Modify the control dependencies in the web.config file.
Solution 2: Optimize the usage of controls on the master page; this can be done either by deleting the duplicates, or integrating 2 or more control in one control.
The solution 2 is a complex one, where as the solution 1 is a simple modification as show below


Search for the following tag in the web config file and chage the DirectFileDependecies

<- SafeMode MaxControls="200" CallStack="true" DirectFileDependencies="20" TotalFileDependencies="50" AllowPageLevelTrace="false">
By default the DirectFileDependecies will be set to 10, you can change to any limit u require.

1 comment:

Shailendra said...

Thanks,
It was so helpful