Could not find type DbCommandDefinition in System.Data.Common and in System.Data.Entity.Core.Common

StackOverflow https://stackoverflow.com/questions/14498700

  •  17-01-2022
  •  | 
  •  

質問

someone who can help me with this error:

[InvalidOperationException: Could not find type DbCommandDefinition in System.Data.Common and in System.Data.Entity.Core.Common]

HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupDatabaseDefaultConnectionFactoryIfNeeded() +913 HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupEntityFrameworkIntegration() +19 HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize() +37 FruconService.App_Start.EntityFrameworkProfilerBootstrapper.PreStart() +23

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +335
System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28 System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters) +19
WebActivator.BaseActivationMethodAttribute.InvokeMethod() +221
WebActivator.ActivationManager.RunActivationMethods() +491
WebActivator.ActivationManager.RunPreStartMethods() +28
WebActivator.ActivationManager.Run() +55

[InvalidOperationException: The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.Compilation.BuildManager.InvokePreStartInitMethods(ICollection`1 methods) +423
System.Web.Compilation.BuildManager.CallPreStartInitMethods() +306
System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +677

[HttpException (0x80004005): The pre-application start initialization method Run on type WebActivator.ActivationManager threw an exception with the following error message: Exception has been thrown by the target of an invocation..]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9088796 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +97 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +258"

It appears on my MVC4 Web api that is deployed on our webserver. We noticed that the error temporary goes away after re-deploy the binaries. Then, the error comes back after some hours.

setup up: WC4 wep api EF5 + EF5.x DB context generator for VB.Net

Thanks in advance!

EDIT: I noticed a reference to HibernateRhinos in the stacktrace. This is a part of a 3th party EF-profiler that I tried.
For now, I removed this profiler from the project to see if the error comes up again or not. To be honest, I suspect this component....

役に立ちましたか?

解決

ok, I answer this topic myself. The problem was surely related to the 3th-party component. I didn't have the problem since i removed it.

I post this because it can help other people...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top