Warning IDs 1310 in the Application Log with Autodiscover VDir that replies with HTTP error 500

Hello everyone,
recently we worked on a support case where our Customer with Exchange 2010 SP3+ had to uninstall the RU12.

After the uninstallation on the Application Log this event started to be tracked:

Log Name: Application
Source: ASP.NET 2.0.50727.0
Date: 10/03/2016 11:24:50
Event ID: 1310
Task Category: Web Event
Level: Warning
Keywords: Classic
User: N/A
Computer: myserver.contoso.com
Description:
Event code: 3008
Event message: A configuration error has occurred.
Event time: 10/03/2016 11:24:50
Event time (UTC): 10/03/2016 10:24:50
Event ID: b79c0d9c71b84b3c8b6f800617931968
Event sequence: 1
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/ROOT/Autodiscover-844-131020790813502672
Trust level: Full
Application Virtual Path: /Autodiscover
Application Path: C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Autodiscover\
Machine name: myserver

Process information:
Process ID: 18188
Process name: w3wp.exe
Account name: NT AUTHORITY\SYSTEM

Exception information:
Exception type: HttpException
Exception message: Could not load file or assembly 'Microsoft.Exchange.Security, Version=14.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Autodiscover\web.config line 940)

Request information:
Request URL: https://autodiscover.contoso.com:443/autodiscover/autodiscover.xml
Request path: /autodiscover/autodiscover.xml
User host address: 192.168.1.51
User:
Is authenticated: False
Authentication Type:
Thread account name: NT AUTHORITY\SYSTEM

Thread information:
Thread ID: 22
Thread account name: NT AUTHORITY\SYSTEM
Is impersonating: False
Stack trace: at System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()
at System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()
at System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters)

 

Outlook clients were unable to access to the Autodiscover VDir:

2016-03-11 08:55:42 192.168.1.51 POST /autodiscover/autodiscover.xml - 443 - 10.120.40.89 Microsoft+Office/15.0+(Windows+NT+6.1;+Microsoft+Outlook+15.0.4569;+Pro) 500 0 0 11107
2016-03-11 08:55:45 192.168.1.51 POST /autodiscover/autodiscover.xml - 443 - 10.120.40.89 Microsoft+Office/15.0+(Windows+NT+6.1;+Microsoft+Outlook+15.0.4569;+Pro) 500 0 0 15
2016-03-11 08:55:45 192.168.1.51 GET /autodiscover/autodiscover.xml - 80 - 10.120.40.89 Microsoft+Office/15.0+(Windows+NT+6.1;+Microsoft+Outlook+15.0.4569;+Pro) 500 0 0 218
2016-03-11 08:55:52 192.168.1.51 POST /autodiscover/autodiscover.xml - 443 - 10.120.40.89 Microsoft+Office/15.0+(Windows+NT+6.1;+Microsoft+Outlook+15.0.4569;+Pro) 500 0 0 15

 

This issue was caused by the uninstallation procedure that modifies the C:\Program Files\Microsoft\Exchange Server\V14\ClientAccess\Autodiscover\web.config file.
The procedure replaces the “C:\Program Files\Microsoft\Exchange Server\V14\Bin\...“ entries with the %ExchangeInstallDir% environment variable.

An example:

[...]

<assemblyIdentity name="Microsoft.Exchange.Configuration.RedirectionModule" publicKeyToken="31bf3856ad364e35"

culture="neutral"/>

<codeBase version="14.0.0.0" href="file :///%ExchangeInstallDir% bin\Microsoft.Exchange.Configuration.RedirectionModule.dll"/>

</dependentAssembly>

[...]

 

Problem is we don't have any %ExchangeInstallDir% environment variable.

So, to solve it we have two possible solutions:

1. Run the updatecas.ps1 and updateconfigfile.ps1 scripts (actually just the last one)

OR

2. Uninstall and reinstall the current RU to restore assemblies and config files

 

Hope this will help you.

Thanks,

Cristian