in

Dot Net Mafia

Group site for developer blogs dealing with (usually) Ionic, .NET, SharePoint, Office 365, Mobile Development, and other Microsoft products, as well as some discussion of general programming related concepts.

This Blog

Syndication

Archives

Corey Roth [MVP]

A SharePoint MVP bringing you the latest time saving tips for Ionic, SharePoint, and Office 365.

Safe Mode did not start successfully. Request failed.

When every page on your SharePoint server returns an error, more often than not, SharePoint was unable to enter Safe Mode.  Safe Mode is the process in which SharePoint goes through to validate that web controls are allowed to be used in SharePoint.  If something goes wrong in this process, you will get a multitude of errors including this one I mentioned in the past regarding your master page.  Recently, I encountered the following error.

Request failed.   at System.Reflection.Assembly._GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Reflection.Assembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
   at System.Web.UI.Util.GetTypeFromAssemblies(ICollection assemblies, String typeName, Boolean ignoreCase)
   at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)
   at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
   at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)

This error occurred on every page I tried to access.  I immediately went to the logs (C:\Program Files\Common Files\Web Server Extensions\12\LOGS) to see if I could figure out what was going on.  I encourage you to always start here first when things aren't working right in SharePoint.  Although they are hard to sift through, the actual error you may be experiencing can usually be found here.  Find the most recently created file and go from there.  Just remember, there is a slight delay from when an error occurs to when it actually gets written to the log.  Anyhow, after I received the error and went to the logs, I found the following lines that looked to be the culprit.

SafeControl load exception:MyCompany.MySharePoint.dll, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null Exception: Request failed. 

Safe mode did not start successfully. Request failed.

Given this, I knew I had an issue with SharePoint going into Safe Mode as I mentioned earlier, but the error was slightly different that what I had seen in the past with the Master Page error.  I have actually found that a few things can cause this.  First, start out by checking your bin folder for your web application.  Make sure that there are not any DLLs in that folder that do not belong (such as Microsoft.SharePoint.dll).  Also make sure that all of the DLLs refernced in the SafeControls element of your web.config that are present in your web.config (excluding anything that you might have put in the GAC).  What I mean here is if you have a custom DLL and maybe you changed the signature of it or renamed it, make sure that the SafeControl element matches the name of each DLL in the bin folder.

If none of that works, start going through the project of the DLL that was listed in the SafeControl load exception.  Start examining every control you have.  Make sure the references in the compiler directives of your .ascx files match what you have in your .ascx.cs files.  Even though your solution may compile, it doesn't mean there isn't something wrong with it.  So start with your latest checkins and look at each file and see if you can get it to work.  Also one thing of note is that if you are getting this error, you can usually remove the DLL from your bin folder and get your site to render.  The tricky part is just finding which file is the offending one.

Published Sep 24 2008, 04:09 PM by CoreyRoth
Filed under: ,

Comments

 

Safe mode did not start successfully. Could not load file or assembly « Edward Wilde said:

Pingback from  Safe mode did not start successfully. Could not load file or assembly «  Edward Wilde

December 22, 2009 5:41 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About CoreyRoth

Corey Roth is an independent SharePoint consultant specializing in ECM, Apps, and Search.
2018 dotnetmafia.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems