SharePoint Search shows Unexpected error has occurred. We Parts Maintenance Page

Issue

You go to the search page in SharePoint Foundation and the page breaks giving you. This page has a SearchBoxScriptWebPart web part on it.

“Sorry, something went wrong”

An unexpected error has occurred.

Web Parts Maintenance Page: If you have permission, you can use this page to temporarily close Web Parts or remove personal settings. For more information, contact your site administrator.

Looking at the ULS logs you see:

Error Messages

Unexpected    System.InvalidProgramException: Common Language Runtime detected an invalid program. at Microsoft.Office.Server.Search.WebControls.SearchCommon.GetUserAdvancedLanguageSettingsUrl() at Microsoft.Office.Server.Search.WebControls.ScriptApplicationManager..ctor() at Microsoft.Office.Server.Search.WebControls.ScriptApplicationManager.GetCurrent(Page page) at Microsoft.Office.Server.Search.WebControls.SearchBoxScriptWebPart.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.AddedControl(Control control, Int32 index) at System.Web.UI.WebControls.WebParts.WebPartManager.WebPartManagerControlCollection.AddWebPartHelper(WebPart webPart) at System.Web.UI.WebControls.WebParts.WebPartManager.WebPartManagerControlCo…    58dbb69c-dd77-30e8-f376-6b788cd43e6a

Unexpected    …llection.AddWebPart(WebPart webPart) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.AddWebPartWithRetry(WebPart webPart) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.CreateWebPartsFromRowSetData(Boolean onlyInitializeClosedWebParts) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.LoadWebParts() at Microsoft.SharePoint.WebPartPages.SPWebPartManager.OnPageInitComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    58dbb69c-dd77-30e8-f376-6b788cd43e6a

Solution

Install an update on your server.

http://www.microsoft.com/en-us/download/details.aspx?id=42268

After Applying the Solution:

Everything works fine and you get the search page.