2011-03-27 187 views
6

我有一個WCF 4服務與2端點配置爲使用wsHttpBinding和netTcpBinding。我使用WAS在IIS 7.5中託管服務,並將使用Ninject的WCF擴展插入到我的服務中。當我使用wsHttpBinding端點調用我的服務時,我的服務工作正常,但在使用netTcpBinding時失敗。當我查看我的應用程序事件日誌時,出現下面列出的以下錯誤。Ninject WCF擴展ArgumentNullException使用NET.TCP綁定

我已經嘗試過在VS2010中調試問題,但是我無法用這個快速調試。如果可能的話,我不想從我的WCF服務中刪除Ninject。我明白,我可以只使用wsHttpBinding,但我是一個內部服務,我想獲得netTcpBindings提供的性能收益。

WebHost failed to process a request. 
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/3018
Exception: System.ServiceModel.ServiceActivationException: The service '/ProfileService.svc' cannot be activated due to an exception during compilation. The exception message is: Cannot be null 
Parameter name: root. ---> System.ArgumentNullException: Cannot be null 
Parameter name: root 
    at Ninject.Infrastructure.Ensure.ArgumentNotNull(Object argument, String name) in c:\Projects\Ninject\ninject\src\Ninject\Infrastructure\Ensure.cs:line 20 
    at Ninject.ResolutionExtensions.Get[T](IResolutionRoot root, IParameter[] parameters) in c:\Projects\Ninject\ninject\src\Ninject\Syntax\ResolutionExtensions.cs:line 37 
    at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) 
    at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) 
Process Name: w3wp 
Process ID: 8656 

有沒有人可以幫助解決這個問題?任何幫助這一個將不勝感激。

回答

4

看到答案,谷歌新聞組中的同一個問題:http://groups.google.com/group/ninject/browse_thread/thread/54108ef9e848b8f0

+0

謝謝雷莫,這是我的帖子在Ninject組,哈哈。我想我會同時發帖,以確保我能夠很好地報道我認爲可能成爲專家類型問題的答案。仍然在努力,所以一旦我找到答案將張貼在這裏供其他人查看。 – Cragly 2011-03-28 09:42:52