locked
Moxiemanager and Entity Framework errors RRS feed

  • Question

  • User1811753808 posted

    Hi all,

    Trying to install Moxiemanager as a TinyMCE plugin on an MVC project. All works fine till we build, and get the following error:
    "Could not load type 'System.Data.Entity.Infrastructure.TableExistenceChecker' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

    With the following stacktrace:

    [TypeLoadException: Could not load type 'System.Data.Entity.Infrastructure.TableExistenceChecker' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.]
       System.Data.Entity.SqlServer.SqlProviderServices..ctor() +0
       System.Data.Entity.SqlServer.SqlProviderServices..cctor() +30
    
    [TypeInitializationException: The type initializer for 'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception.]
       System.Data.Entity.SqlServer.SqlProviderServices.get_Instance() +14
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
       System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +192
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +155
       System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) +61
       System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) +19
       System.Data.Entity.Utilities.MemberInfoExtensions.GetValue(MemberInfo memberInfo) +91
       System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(Type providerType) +67
       System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(String providerTypeName, String providerInvariantName) +38
       System.Data.Entity.Internal.AppConfig.<.ctor>b__2(ProviderElement e) +71
       System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +145
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +381
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
       System.Data.Entity.Internal.AppConfig.<.ctor>b__1() +83
       System.Lazy`1.CreateValue() +180
       System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() +22
       System.Lazy`1.get_Value() +11212537
       System.Data.Entity.Internal.AppConfig.get_DbProviderServices() +9
       System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.RegisterDbProviderServices() +18
       System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetServiceFactory(Type type, String name) +92
       System.Data.Entity.Infrastructure.DependencyResolution.<>c__DisplayClass1.<GetService>b__0(Tuple`2 t) +42
       System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +72
       System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetService(Type type, Object key) +140
       System.Data.Entity.Infrastructure.DependencyResolution.<>c__DisplayClass3.<GetService>b__0(IDbDependencyResolver r) +19
       System.Linq.WhereSelectArrayIterator`2.MoveNext() +66
       System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source, Func`2 predicate) +94
       System.Data.Entity.Infrastructure.DependencyResolution.ResolverChain.GetService(Type type, Object key) +160
       System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type type, Object key) +39
       System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService(IDbDependencyResolver resolver) +78
       System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection internalConnection, DbCompiledModel model) +77
       System.Data.Entity.DbContext..ctor(String nameOrConnectionString) +60
       Dashboard.Controllers.StudentBansController..ctor() +32
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) +0
       System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +113
       System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) +232
       System.Activator.CreateInstance(Type type, Boolean nonPublic) +83
       System.Activator.CreateInstance(Type type) +66
       System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +55
    
    [InvalidOperationException: An error occurred when trying to create a controller of type 'Dashboard.Controllers.StudentBansController'. Make sure that the controller has a parameterless public constructor.]
       System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +178
       System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +77
       System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +88
       System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +193
       System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +50
       System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +48
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16
       System.Web.Mvc.<>c__DisplayClass7.<BeginProcessRequest>b__6() +31
       System.Web.Mvc.ServerExecuteHttpHandlerWrapper.Wrap(Func`1 func) +27
       System.Web.Mvc.ServerExecuteHttpHandlerAsyncWrapper.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +98
       System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride) +2019
       System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage) +76
       System.Web.HttpServerUtility.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +28
       System.Web.HttpServerUtilityWrapper.Execute(IHttpHandler handler, TextWriter writer, Boolean preserveForm) +19
       System.Web.Mvc.Html.ChildActionExtensions.ActionHelper(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues, TextWriter textWriter) +464
       System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName, RouteValueDictionary routeValues) +83
       System.Web.Mvc.Html.ChildActionExtensions.Action(HtmlHelper htmlHelper, String actionName, String controllerName) +11
       ASP._Page_Views_Home_Index_cshtml.Execute() in d:\Inetpub\WWWroot\intranet\SWGS\Dashboard\Dashboard\Views\Home\Index.cshtml:12
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +198
       System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +105
       System.Web.WebPages.StartPage.RunPage() +17
       System.Web.WebPages.StartPage.ExecutePageHierarchy() +64
       System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +78
       System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +235
       System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +107
       System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +291
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +56
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +420
       System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +52
       System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +173
       System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100
       System.Web.Mvc.Async.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult) +10
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
       System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27
       System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
       System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +39
       System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +28
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
       System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +29
       System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10
       System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21
       System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
       System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +54
       System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +31
       System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +9690172
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
    

    Taking Moxiemanager out again then works. Anyone got any ideas what could be causing this? Spoke to MoxieCode support but they said it's nothing to do with them as they don't actually use Entity Framework. Our EF version is 6.1.3, is it likely that we need to downgrade?

    Thanks
    Chris

    Thursday, April 23, 2015 3:47 AM

All replies

  • User1938476581 posted

    Hi,

    get the following error:
    "Could not load type 'System.Data.Entity.Infrastructure.TableExistenceChecker' from assembly 'EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'."

    According to the description, The version of the EF in the gac is 6.0 instead of 6.1.3. So we can downgrade the EF version for the website via nuget.

    Thursday, April 30, 2015 2:28 AM