"The type initializer for 'Microsoft.Practices.EnterpriseLibrary.Logging.LogEntry' threw an exception."When you dig for the inner exception, you find:
Could not load file or assembly 'System.Management, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied.I've tried numerous things to get around this, such as:
- Changing the application pool identity to Local System
- Directly referencing System.Management in the service assembly
- Adding System.Management (and the Ent Lib assemblies, for that matter) to the <assemblies> node in the web.config
<client>Then, for some reason, an IIS reset was needed to make the client start working. This article describes the problem in detail.
Here's the thread over on the Enterprise Library forums where I was corresponding about the issue.