### Steps to reproduce
I simply set an interceptor to log the queries and commands generated by EF. This is the setting I used:
```
<interceptors>
<interceptor type="System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework">
<parameters>
<parameter value="C:\Users\Public\EF-Log-Output.txt" />
</parameters>
</interceptor>
</interceptors>
```
### The issue
When I run to queries from different threads, it raises the following exception:
> System.IO.IOException
> The process cannot access the file 'C:\Users\Public\EF-Log-Output.txt' because it is being used by another process.
The following is the code I used to execute queries asynchronously:
```
public async Task SyncCacheEntities(string connectionString)
{
var task1 = SyncUserProfile(cacheContext);
var task2 = SyncUserAvatar(cacheContext);
await Task.WhenAll(task1, task2);
}
```
### Stack trace:
```
> System.TypeInitializationException: The type initializer for 'SaShi.DbLayer.EhrContext' threw an exception. ---> System.InvalidOperationException: The type 'System.Data.Entity.Infrastructure.Interception.DatabaseLogger, EntityFramework' registered in the application config file as an IDbInterceptor not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.IOException: The process cannot access the file 'C:\Users\Public\EF-Log-Output.txt' because it is being used by another process.
> at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
> at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
> at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
> at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
> at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
> at System.IO.StreamWriter..ctor(String path, Boolean append)
> at System.Data.Entity.Infrastructure.Interception.DatabaseLogger..ctor(String path, Boolean append)
> --- End of inner exception stack trace ---
> at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
> at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
> at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
> at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
> at System.Activator.CreateInstance(Type type, Object[] args)
> at System.Data.Entity.Internal.ConfigFile.InterceptorElement.CreateInterceptor()
> --- End of inner exception stack trace ---
> at System.Data.Entity.Internal.ConfigFile.InterceptorElement.CreateInterceptor()
> at System.Data.Entity.Internal.ConfigFile.InterceptorsCollection.<get_Interceptors>b__0(InterceptorElement e)
> at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at System.Data.Entity.Internal.ConfigFile.InterceptorsCollection.get_Interceptors()
> at System.Data.Entity.Internal.AppConfig.get_Interceptors()
> at System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetServicesFactory(Type type, Object key)
> at System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.<>c__DisplayClass8.<GetServices>b__3(Tuple`2 t)
> at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
> at System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetServices(Type type, Object key)
> at System.Data.Entity.Infrastructure.DependencyResolution.ResolverChain.<>c__DisplayClass6.<GetServices>b__5(IDbDependencyResolver r)
> at System.Linq.Enumerable.<SelectManyIterator>d__16`2.MoveNext()
> at System.Linq.Enumerable.<ConcatIterator>d__58`1.MoveNext()
> at System.Linq.Enumerable.<OfTypeIterator>d__92`1.MoveNext()
> at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
> at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
> at System.Data.Entity.Infrastructure.DependencyResolution.InternalConfiguration.Lock()
> at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.<.ctor>b__1()
> at System.Lazy`1.CreateValue()
> at System.Lazy`1.LazyInitValue()
> at System.Lazy`1.get_Value()
> at System.Data.Entity.Infrastructure.DependencyResolution.DbConfigurationManager.GetConfiguration()
> at System.Data.Entity.Database.SetInitializer[TContext](IDatabaseInitializer`1 strategy)
> at SaShi.DbLayer.EhrContext..cctor() in d:\Sayid\Projects\iMedex\Source\Data.DbLayer\EhrContext.cs:line 66
> --- End of inner exception stack trace ---
> at SaShi.DbLayer.EhrContext..ctor()
> at SaShi.DbLayer.ContextProviders.EhrDb.GetInstance() in d:\Sayid\Projects\iMedex\Source\Data.DbLayer\ContextProviders\EhrDb.cs:line 13
> at SaShi.Data.Service.DbService.DbGenericService.<GetListByModelAsync>d__5`2.MoveNext() in d:\Sayid\Projects\iMedex\Source\Data.Service\DbService\DbGenericService.cs:line 37
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
> at SaShi.Data.Service.Security.Users.UserDataService.<GetAllAsync>d__0.MoveNext() in d:\Sayid\Projects\iMedex\Source\Data.Service\Security\Users\UserDataService.cs:line 39
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
> at SaShi.Data.Service.CacheService.CacheServerDataService.<SyncUserProfile>d__b.MoveNext() in d:\Sayid\Projects\iMedex\Source\Data.Service\CacheService\CacheServerDataService.cs:line 41
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
> at SaShi.Data.Service.CacheService.CacheServerDataService.<SyncCacheEntities>d__4.MoveNext() in d:\Sayid\Projects\iMedex\Source\Data.Service\CacheService\CacheServerDataService.cs:line 36
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
> at SaShi.Business.Server.Web.CacheServer.CacheServerLogic.<SyncServer>d__8.MoveNext() in d:\Sayid\Projects\iMedex\Source\Business.Server.Web\CacheServer\CacheServerLogic.cs:line 103
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
> at SaShi.UI.Server.Web.Controllers.CacheServersController.<SyncServer>d__2.MoveNext() in d:\Sayid\Projects\iMedex\Source\UI.Server.Web\Controllers\CacheServersController.cs:line 95
> --- End of stack trace from previous location where exception was thrown ---
> at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
> at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
> at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
> at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
> at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
> at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
>