开发者

error deploying asp.net mvc3 application with System.Data.Objects.ObjectSet

Maybe you can give a clue about this error, I have been googling and testing things for hours without result. I am using Mysql and Mysql connector 6.3.5. The error only happens on server, locally everything goes well.

The error:

Method not found: 'System.Data.Objects.ObjectSet`1 MyModelEntities.get_my_aspnet_Users()'.

StackTrace:

[MissingMethodException: Method not found: 'System.Data.Objects.ObjectSet`1 MyModelEntities.get_my_aspnet_Users()'.] Utils.GetCurrentUserId() +0

Project.Controllers.ApplicationController..ctor() +70 Project.Controllers.HomeController..ctor() +29

[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) +98

System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +241 System.Activator.CreateInstance(Type type, Boolean nonPublic) +69

System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +67

[InvalidOperationException: An error occurred when trying to create a controller of type 'Project.Controllers.HomeController'. Make sure that the controller has a parameterless public constructor.]

System.Web.Mvc.DefaultControllerActivator.Create(RequestContext request开发者_开发知识库Context, Type controllerType) +182 System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType) +80 System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +74 System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +196

System.Web.Mvc.<>c_DisplayClass6.b_2() +49 System.Web.Mvc.<>c__DisplayClassb1.<ProcessInApplicationTrust>b__a() +13 System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7

System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22

System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func1 func) +124

System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +98

System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state) +50

System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +16

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8841400 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +184


A little bit more background info on your model would be needed to pinpoint the issue.

If I had to infer with only the stack trace... It seems that in your HomeController constructor there is a call to get_my_aspnet_Users on your model class - MyModelEntities. For some reason the code is not able to find that method.

Is it possible that you somehow have an older version of the model file that does not have the particular method your code is looking for?

Hope this helps.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜