2012-05-09 6 views
0

내 로컬 컴퓨터에서 ASP.NET MVC 3 응용 프로그램이 제대로 작동하지만 (보통 배포 할 때 잘 동작합니다),이 경우 다음 오류가 발생합니다. 서버 R2 IIS7와 윈도우 2008입니다배포 - 객체 참조가 객체의 인스턴스로 설정되지 않았습니다.

편집 :

사람은 내가 찾아야 무엇에 어떤 포인터를 얻을 수 (그 도움이된다면) 보테 ILoggingService & IConfigSettings이 모두 Ninject에 의해 싱글 범위에 묶여있다?

Object reference not set to an instance of an 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.NullReferenceException: Object reference not set to an instance of an 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: 


[NullReferenceException: Object reference not set to an instance of an object.] 
DataPortal.Models.Repositories.KpiRepository..ctor(ILoggingService ls, IConfigSettings configSettings) +1295 
DynamicInjector3f592a0195c345d8a7d555c4c4085e12(Object[]) +128 
Ninject.Activation.Context.Resolve() +279 
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +237 
System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +298 
System.Linq.WhereSelectArrayIterator`2.MoveNext() +109 
System.Linq.Buffer`1..ctor(IEnumerable`1 source) +487 
System.Linq.Enumerable.ToArray(IEnumerable`1 source) +103 
Ninject.Activation.Providers.StandardProvider.Create(IContext context) +479 
Ninject.Activation.Context.Resolve() +279 
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +237 
System.Linq.Enumerable.SingleOrDefault(IEnumerable`1 source) +298 
System.Web.Mvc.DefaultControllerActivator.Create(RequestContext requestContext, Type controllerType) +67 

[InvalidOperationException: An error occurred when trying to create a controller of type 'DataPortal.Controllers.KpiController'. 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() +405 
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375 
+0

IIS8.5와 함께 2008 R2가 제공됩니다. –

답변

1

"LoggingService 또는 ConfigSettings"인수가 web.config에 올바르게 구성되지 않은 것 같습니다. 이전 작업 버전 구성 파일을 확인하십시오.

+0

작업 복사본의 Web.config와 작동하지 않는 테스트 서버 복사본은 모두 동일합니다 – MrBliz

+1

종속성 주입을 사용하고 있으므로 모든 종속 DLL이 있는지 확인하십시오. 전개 된 위치의 bin 디렉토리로 복사됩니다. 작업 및 비 작업 폴더의 bin 디렉토리를 비교하십시오. 그게 도움이 될거야. – Esen

+0

감사합니다. 이미 해 봤습니다. 흥미롭게도 배포 된 위치에는 로컬 폴더보다 하나 많은 파일이 있습니다. – MrBliz

3

결국 종속성 문제였습니다. 프로젝트가 배포되지 않은 다른 프로젝트에 종속되었습니다.

관련 문제