2012-05-09 30 views
0

私のASP.NET MVC 3アプリケーションはローカルマシンで正常に動作しますが、通常はうまく動作しますが、この場合、次のエラーが発生します。サーバーは、R2 IIS7とWindows 2008のある展開 - オブジェクト参照がオブジェクトのインスタンスに設定されていません

EDIT:

誰もが私がどうあるべきか上の任意のポインタを取得します(それは場合に役立ちます)ボーテ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

小さなニックピット:2008 R2にはIIS7.5が付属 –

答えて

1

あなたの引数 "LoggingServiceまたはConfigSettings"がweb.configで正しく設定されていないようです。前の作業バージョン設定ファイルを確認してください。

+0

私の作業用ローカルコピーのWeb.configと動作していないテスト用サーバーコピーの両方がまったく同じです – MrBliz

+1

依存関係の注入を使用しているので、依存するすべてのDLLがデプロイされた場所のbinディレクトリにコピーされます。あなたの作業フォルダと非作業フォルダのbinディレクトリを比較してください。それは助けるかもしれません。 – Esen

+0

私はすでにそれをやってきました。興味深いことに、展開された場所には、ローカルフォルダよりも1つ多くファイルがあります。 – MrBliz

3

最後に依存問題でした。このプロジェクトは、配備されていない別のプロジェクトに依存していました。

関連する問題