Wednesday, November 27, 2024

[Solved] “Could not load file or assembly AntiXSSLibrary” on Exchange 2016

Abstract: On your fresh new Exchange 2016 Server you noticed multiple ASP.NET 4.0.30319.0 errors which comes up every 5min.

The full event log error is:

Event code: 3008 
Event message: A configuration error has occurred.
Event time: 2016-05-11 13:05:33
Event time (UTC): 2016-05-11 11:05:33
Event ID: c3f035fa9e1c44a4b8658abe1cd9e687
Event sequence: 1
Event occurrence: 1
Event detail code: 0
 
Application information:
    Application domain: /LM/W3SVC/2/ROOT/owa-23878-131074383328759852
    Trust level: Full
    Application Virtual Path: /owa
    Application Path: C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\owa\
    Machine name: EXCH01
 
Process information:
    Process ID: 2632
    Process name: w3wp.exe
    Account name: NT AUTHORITY\SYSTEM
 
Exception information:
    Exception type: ConfigurationErrorsException
    Exception message: Could not load file or assembly 'AntiXSSLibrary, Version=4.2.0.0, Culture=neutral, PublicKeyToken=d127efab8a9c114f' or one of its dependencies. The system cannot find the file specified. (C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\owa\web.config line 111)
   at System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)
   at System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   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 'AntiXSSLibrary, Version=4.2.0.0, Culture=neutral, PublicKeyToken=d127efab8a9c114f' 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://localhost:444/owa/proxylogon.owa
    Request path: /owa/proxylogon.owa
    User host address: 127.0.0.1
    User: 
    Is authenticated: False
    Authentication Type: 
    Thread account name: NT AUTHORITY\SYSTEM
 
Thread information:
    Thread ID: 104
    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.AssemblyInfo.get_AssemblyInternal()
   at System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)
   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:

If you check the C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\owa\web.config and search for AntiXSSLibrary you will only find one hit, however no .dll. So the file must be inherited somewhere else. A closer inspection showed that the linkedConfiguration section mention the file C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\SharedWebConfig.config. BUT on the exchange server this file is missing. If you open the file on another Exchange 2016 server you can see that it references to C:\Program Files\Microsoft\Exchange Server\V15\bin\AntiXssLibrary.dll.

So the quick (and maybe dirty) solution might be to copy the missing C:\Program Files\Microsoft\Exchange Server\V15\ClientAccess\SharedWebConfig.config from one Exchange 2016 server to your current one which has the file missing.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Stay Connected

35FollowersFollow
- Advertisement -

Latest Articles