EntityFramework DatabaseLogger Interceptor cannot be loaded on server

entity-framework entity-framework-6

Question

Adding DatabaseLogger Interceptor as per https://blog.oneunicorn.com/2014/02/09/ef-6-1-turning-on-logging-without-recompiling/

<interceptors>
  <interceptor type="System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework">
    <parameters>
      <parameter value="D:\TempLogging\LogOutput.txt"/>
      <parameter value="true" type="System.Boolean"/>
    </parameters>
  </interceptor>
</interceptors>

Works fine on local, dev and QA boxes but on customer server adding this config throws error

The type 'System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework' registered in the application config file as an IDbInterceptor could not be loaded

The EntityFramework.dll is in the server's bin directory.

Any ideas what could be causing the problem on this server? Any other things to check?

1
2
12/7/2016 2:45:31 PM

Popular Answer

This can happen if the drive or path to the file is invalid (or not accessible).

<parameter value="D:\TempLogging\LogOutput.txt"/>

In your case, make sure drive D: and TempLogging folder exist and writable.

1
9/11/2017 2:23:37 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow