Hallo Leser,

wieder einmal hat mich ein neu installierter Exchange Server irritiert. Obwohl auf Windows Server 2016 Exchange Server 2016 CU 10 installiert wurde, habe ich immer wieder einen Eintrag im Application Log:

01- EventID1310-IIS-Exchange

Application Log Event ID 1310

Der Inhalt der Fehlermeldung:

Log Name:      Application
Source:        ASP.NET 4.0.30319.0
Date:          05.09.2018 11:48:13
Event ID:      1310
Task Category: Web Event
Level:         Warning
Keywords:      Classic
User:          N/A
Computer:      <servername>.<serverdomain>
Description:
Event code: 3008 
Event message: A configuration error has occurred. 
Event time: 05.09.2018 11:48:13 
Event time (UTC): 05.09.2018 09:48:13 
Event ID: ec867e69a5f947a9aff2894a2dd76512 
Event sequence: 1 
Event occurrence: 1 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/2/ROOT/mapi/emsmdb-2622-131806144936928479 
    Trust level: Full 
    Application Virtual Path: /mapi/emsmdb 
    Application Path: D:\Exchange Server\ClientAccess\mapi\emsmdb\ 
    Machine name: <servername> 
 
Process information: 
    Process ID: 8488 
    Process name: w3wp.exe 
    Account name: NT AUTHORITY\SYSTEM 
 
Exception information: 
    Exception type: ConfigurationErrorsException 
    Exception message: Could not load file or assembly 'Microsoft.Exchange.MapiHttpHandler, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (D:\Exchange Server\ClientAccess\mapi\emsmdb\web.config line 102)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

Could not load file or assembly 'Microsoft.Exchange.MapiHttpHandler, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)

 
 
Request information: 
    Request URL: https://<servername>.<serverdomain>:444/mapi/emsmdb/?mailboxId=<mailboxid>@<maildomain>.de 
    Request path: /mapi/emsmdb/ 
    User host address: <hostip>
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: NT AUTHORITY\SYSTEM 
 
Thread information: 
    Thread ID: 108 
    Thread account name: NT AUTHORITY\SYSTEM 
    Is impersonating: False 
    Stack trace:    at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
 
 
Custom event details: 

Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="32768">1310</EventID>
    <Level>3</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2018-09-05T09:48:13.882870400Z" />
    <EventRecordID>123290</EventRecordID>
    <Channel>Application</Channel>
    <Computer><servername>.<serverdomain></Computer>
    <Security />
  </System>
  <EventData>
    <Data>3008</Data>
    <Data>A configuration error has occurred.</Data>
    <Data>05.09.2018 11:48:13</Data>
    <Data>05.09.2018 09:48:13</Data>
    <Data>ec867e69a5f947a9aff2894a2dd76512</Data>
    <Data>1</Data>
    <Data>1</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/2/ROOT/mapi/emsmdb-2622-131806144936928479</Data>
    <Data>Full</Data>
    <Data>/mapi/emsmdb</Data>
    <Data>D:\Exchange Server\ClientAccess\mapi\emsmdb\</Data>
    <Data><servername></Data>
    <Data>
    </Data>
    <Data>8488</Data>
    <Data>w3wp.exe</Data>
    <Data>NT AUTHORITY\SYSTEM</Data>
    <Data>ConfigurationErrorsException</Data>
    <Data>Could not load file or assembly 'Microsoft.Exchange.MapiHttpHandler, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (D:\Exchange Server\ClientAccess\mapi\emsmdb\web.config line 102)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)

Could not load file or assembly 'Microsoft.Exchange.MapiHttpHandler, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
   at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)

</Data>
    <Data>https://<servername>.<serverdomain>:444/mapi/emsmdb/?mailboxId=<mailboxid>@<maildomain>.de</Data>
    <Data>/mapi/emsmdb/</Data>
    <Data><hostid></Data>
    <Data>
    </Data>
    <Data>False</Data>
    <Data>
    </Data>
    <Data>NT AUTHORITY\SYSTEM</Data>
    <Data>108</Data>
    <Data>NT AUTHORITY\SYSTEM</Data>
    <Data>False</Data>
    <Data>   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   at System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()
   at System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded)
   at System.Web.Compilation.BuildManager.ExecutePreAppStart()
   at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)
</Data>
  </EventData>
</Event>

Event ID 1310 – Fehlerbehebung

Um den Fehler zu beheben, habe ich auf dem betroffenen System Folgendes ausgeführt:

UpdateCas.ps1

Im Exchange Installationsverzeichnis ist im Ordner „Bin“ das Script UpdateCas.ps1 zu finden. Entsteht bei der Exchange-Installation oder bei einem Update auf eine höhere CU-Version ein Fehler, kann dieses Script dabei helfen, das OWA- / ECP-Verzeichnis zu reparieren. (Bild 2)

03 - UpdateCas

UpdateCas.ps1

 

UpdateConfigFiles.ps1

Zu dem obigen Befehl UpdateCas.ps1 gehört auch noch der Befehl UpdateConfigFiles.ps1. Das Script ist notwendig, wenn die web.config File durch ein CU-Update o.ä. verändert wurde.

04 - UpdateConfigFiles

UpdateConfigFiles.ps1

DependentAssemblyGenerator.exe

Im nächsten Schritt müssen nun alle WebAssemblys wiederhergestellt werden. Dazu verwende ich das Programm „DependentAssemblyGenerator.exe“, mit dem ich die SharedWebconfig für Frontend und Backend neu generiere:

  1. Administrative CMD öffnen
  2. In das Bin-Verzeichnis vom Exchange wechseln –> cd %ExchangeInstallPath%\bin
  3. Ausführen –>
    DependentAssemblyGenerator.exe -exchangePath "%ExchangeInstallPath%\bin" -exchangePath "%ExchangeInstallPath%\ClientAccess" -configFile "%ExchangeInstallPath%\ClientAccess\SharedWebConfig.config"

    (Bild 5)

  4. End Dependent Assembly Generation (Bild 6)
  5. Ausführen –>
    DependentAssemblyGenerator.exe -exchangePath "%ExchangeInstallPath%\bin" -exchangePath "%ExchangeInstallPath%\FrontEnd\HttpProxy" -configFile "%ExchangeInstallPath%\FrontEnd\HttpProxy\SharedWebConfig.config"

    (Bild 7)

  6. End Dependent Assembly Generation (Bild 8)
  7. Server neu starten
  8. Fertig

Warnung entfernt

Nachdem der Server neu gestartet wurde, taucht die Warnung nun nicht mehr auf. Zuletzt wurde die Warnung protokolliert, als die BackEnd SchredWebconfig neu erstellt wurde (vergleiche Bild 5).

EventID1310

Weiterhin viel Freude als Exchange-Admin ;)

Gruß aus Bielefeld

Andi