Direct Dependencies Limit with Master page User Controls in SharePoint

InfoPath alternatives for form designing SharePoint

The westernaustralia.com web site uses a large number of user controls hard coded across twenty-odd page layouts–a big no-no. While we’ve matured as a dev. team since this site launched and now fully appreciate the value of web parts and a small set of key page layouts, unfortunately the site is live as-is.

Read some SharePoint tutorials on:

From a production support perspective we’re still working on the site and adding new user controls here and there. This shouldn’t be problematic but MOSS, in its infinite wisdom, limits the number of user controls on a page and fails when that limit is reached.



 Direct Dependencies Limit with Master page User Controls in SharePoint
Direct Dependencies Limit with Master page User Controls in SharePoint

When developing large portals, it can often be a mistake. associated with exceeding limit inclusion in external objects, such as pages, .ascx files.

This problem can easily be corrected by editing the Web.config file. For this limit corresponds to the parameter DirectFileDependencies.

If you insert more than 10 user controls in a masterpage, you might get an error similar to this:
The page ‘/path/somefile.master’ allows a limit of 11 direct dependencies, and that limit has been exceeded.

You can easily increase that limit as it is actually set in your sharepoint web.config:

Steps edit web.config




1) Browse to C:\inetpub\wwwroot\wss\VirtualDirectories\

 Direct Dependencies Limit with Master page User Controls in SharePoint
Direct Dependencies Limit with Master page User Controls in SharePoint

2) Open the folder corresponding to your Sharepoint website.

3) Edit the file web.config

4) Do a search for “safemode“.

5) Change the property DirectFileDependencies from 10 to a value your choice.

6) Do an iisreset command and you’re done!


< SafeMode MaxControls = “200” CallStack = “true” DirectFileDependencies = “20” TotalFileDependencies = “50” AllowPageLevelTrace = “false” >

The solution is to simply increase the value to the desired value.


You May Also like the Following SharePoint Online Tutorials:

About Sagar Pardeshi

I am Developer working on Microsoft Technologies for the past 6+years. I am very much passionate about programming and my core skills are SharePoint, ASP.NET & C#,Jquery,Javascript,REST. I am running this blog to share my experience & learning with the community I am an MCP, MCTS .NET & Sharepoint 2010, MCPD Sharepoint 2010, and MCSD HTML 5,Sharepoint 2013 Core Solutions. I am currently working on Sharepoint 2010, MOSS 2007, Sharepoint 2013,Sharepoint 2013 App Dev, C#, ASP.NET, and SQL Server 2008.

View all posts by Sagar Pardeshi →

Leave a Reply