title: type initializer for 'Examine.ExamineManager' threw an exception Umbraco
body: <p>I've had an application built using Umbraco in production for about a month now without problems, but today, a mysterious exception error is being thrown by most of my Razor Script macros. 
  <br /><br />
  <strong>The error is:</strong></p>
  
  <pre><code>Error loading Razor Script AnnouncementSummary.cshtml
  The type initializer for 'Examine.ExamineManager' threw an exception.
  </code></pre>
  
  <p><br />
  <strong>And the details of the exception error are:</strong></p>
  
  <p>Exception</p>
  
  <pre><code>System.TypeInitializationException: The type initializer for 'Examine.ExamineManager' threw an exception. ---&gt; System.Configuration.ConfigurationErrorsException: Method not found: 'Void Examine.Providers.BaseIndexProvider.set_SupportUnpublishedContent(Boolean)'. (C:\inetpub\wwwroot\DCASConnect\DCASConnect\config\ExamineSettings.config line 12) ---&gt; System.MissingMethodException: Method not found: 'Void Examine.Providers.BaseIndexProvider.set_SupportUnpublishedContent(Boolean)'. at UmbracoExamine.UmbracoContentIndexer.Initialize(String name, NameValueCollection config) at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) --- End of inner exception stack trace --- at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType) at System.Web.Configuration.ProvidersHelper.InstantiateProviders(ProviderSettingsCollection configProviders, ProviderCollection providers, Type providerType) at Examine.ExamineManager.LoadProviders() at Examine.ExamineManager..cctor() --- End of inner exception stack trace --- at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id) at umbraco.MacroEngines.DynamicNode.Media(String propertyAlias) at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid2[T0,T1](CallSite site, T0 arg0, T1 arg1) at ASP._Page_macroScripts_AnnouncementSummary_cshtml.Execute() in c:\inetpub\wwwroot\DCASConnect\DCASConnect\macroScripts\AnnouncementSummary.cshtml:line 13
  </code></pre>
  
  <p><br />
  <strong>Inner Exception</strong></p>
  
  <pre><code>Method not found: 'Void Examine.Providers.BaseIndexProvider.set_SupportUnpublishedContent(Boolean)'. (C:\inetpub\wwwroot\DCASConnect\DCASConnect\config\ExamineSettings.config line 12)
  </code></pre>
  
  <p><br />
  This error is only happening on the production environment and I've been doing a lot of digging around the net without any solutions that work. I've tried getting the latest version of Examine and also tried changing the App Pool credentials to Network Service and granting it full access to c:\Windows\Temp. Both suggestions did not work.
  <br /><br />
  <strong>Here is one of my Razor Scripts that's generating the error:</strong></p>
  
  <pre><code>@{ var numberOfItems = 10; }
  @foreach (var item in @Model.Descendants("umbAnnouncementPage").Where("Visible").OrderBy("CreateDate desc").Take(numberOfItems))
  {  
    var imageUrl = "";
    var link = @item.Url;
    string text = @item.shortDescription;
    if (@item.HasValue("articleImage"))
    {  
      item.Media("articleImage"); @*** This is where it fails ***@
              imageUrl = "/usercontrols/ImageGen.ashx?image=" + @item.Media("articleImage").UmbracoFile + "&amp;width=120&amp;crop=resize&amp;pad=false&amp;bgcolor=f2f2f2";
    }
    else
    {
      imageUrl = "/usercontrols/ImageGen.ashx?image=/media/3115/defaultannouncement.jpg&amp;&amp;width=120&amp;&amp;height=80&amp;&amp;constrain=true&amp;&amp;crop=resize";
    }
    if (@item.HasValue("url"))
    {
      link = @item.url;
    }
    var lineOfService = "";
    foreach (var line in @item.Ancestors("umbLineOfService")) {  lineOfService = line.lineOfServiceName; }
      &lt;div class="clearboth"&gt;
        &lt;h4 class="announcement underline-dotted"&gt;&lt;a href="@link"&gt;@item.Title&lt;/a&gt;&lt;/h4&gt;          
        &lt;a class="summaryImageLeft announcementThumbnail" href="@link"&gt;&lt;img alt="" src="@imageUrl" alt="@item.Title"/&gt;&lt;/a&gt;
                  &lt;div class="smaller-text summaryText"&gt;
              @Library.Truncate(@text, 200)
        &lt;/div&gt;
                  &lt;div class="clearboth overline-dotted"&gt;
                      &lt;a class="small-text floatright" href="@link"&gt;Read more...&lt;/a&gt;
                      &lt;span class="small-text"&gt;@lineOfService&lt;/span&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;br /&gt;   }
  </code></pre>
  
  <p><br />
  @item.Media("articleImage") throws the exception on call.</p>
  
  <p>There's a lot of pressure on me to fix this error, so any assistance would be appreciated. Thanks in advance.</p>