2011-09-15 2 views
1

완벽하게 실행중인 로컬 MVC3 응용 프로그램을 Windows Azure에 업로드하려고합니다.Windows Azure, MVC3,이 개체에 대해 매개 변수없는 생성자가 정의되지 않았습니다.

푸른 색으로 응용 프로그램을 업로드하면 "준비 상태"로 표시됩니다.

No parameterless constructor defined for this object. 

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.MissingMethodException: No parameterless constructor defined for this object. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[MissingMethodException: No parameterless constructor defined for this object.] 
    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) +117 
    System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache) +247 
    System.Activator.CreateInstance(Type type, Boolean nonPublic) +106 
    System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +84 

[InvalidOperationException: An error occurred when trying to create a controller of type 'DummyAnwendung.Controllers.AccountController'. Make sure that the controller has a parameterless public constructor.] 
    System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +247 
    System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName) +85 
    System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory) +280 
    System.Web.Mvc.<>c__DisplayClass6.<BeginProcessRequest>b__2() +66 
    System.Web.Mvc.<>c__DisplayClassb`1.<ProcessInApplicationTrust>b__a() +19 
    System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Func`1 func) +161 
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +389 
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371 

가지고 누군가 아이디어, 오류가 발생할 수 있습니다 무엇을 : 나는 그것을 호출 할 경우에, 다음과 같은 오류가 나타 납니까? 내가 DI에 대한 유니티 응용 프로그램 블록을 사용하고 ..

안부 팻

답변

0

오류 메시지가 다음 상태 :

'DummyAnwendung.Controllers.AccountController'. Make sure that the controller has a parameterless public constructor 

당신이 클래스의 생성자를 정의하지 않는 경우 매개 변수없는 생성자가 생성됩니다. 그러나 매개 변수가있는 생성자를 정의하면 매개 변수없는 생성자가 만들어지지 않습니다.

이 클래스의 매개 변수 생성자를 정의하십시오.

+0

이렇게했습니다. 매개 변수없는 생성자를 설정하십시오 :-) – pat

관련 문제