我有一个使用RavenDB客户端版本2.5.2879的ASP.NET MVC 4 Web应用程序,我想将其升级到3.0.30143版本。在使用NuGet进行升级后,解决方案会构建,但是当我运行应用程序时,此行会抛出异常
IndexCreation.CreateIndexes(typeof(xxxxCoreInstaller).Assembly, documentStore);
引发的异常是
No component for supporting the service System.Net.Http.HttpMessageHandler was found
at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)
at Castle.Facilities.TypedFactory.TypedFactoryComponentResolver.Resolve(IKernelInternal kernel, IReleasePolicy scope)
at Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Resolve(IInvocation invocation)
at Castle.Facilities.TypedFactory.Internal.TypedFactoryInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.Func`1Proxy.Invoke()
at Raven.Client.Util.HttpClientCache.GetClient(TimeSpan timeout, OperationCredentials credentials, Func`1 handlerFactory) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Util\HttpClientCache.cs:line 110
at Raven.Client.Connection.Implementation.HttpJsonRequest..ctor(CreateHttpJsonRequestParams requestParams, HttpJsonRequestFactory factory) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequest.cs:line 152
at Raven.Client.Connection.HttpJsonRequestFactory.CreateHttpJsonRequest(CreateHttpJsonRequestParams createHttpJsonRequestParams) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\Implementation\HttpJsonRequestFactory.cs:line 86
at Raven.Client.Connection.Async.AsyncServerClient.<>c__DisplayClassde.<<GetIndexAsync>b__dd>d__e0.MoveNext() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 699
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.ReplicationInformerBase`1.<TryOperationAsync>d__29`1.MoveNext() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\ReplicationInformerBase.cs:line 443
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at Raven.Client.Connection.ReplicationInformerBase`1.<ExecuteWithReplicationAsync>d__19`1.MoveNext() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\ReplicationInformerBase.cs:line 338
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Client.Connection.Async.AsyncServerClient.<ExecuteWithReplication>d__2d1`1.MoveNext() in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\Async\AsyncServerClient.cs:line 0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Raven.Abstractions.Util.AsyncHelpers.<>c__DisplayClassb`1.<<RunSync>b__8>d__d.MoveNext() in c:\Builds\RavenDB-Stable-3.0\Raven.Abstractions\Util\AsyncHelpers.cs:line 75
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at Raven.Abstractions.Util.AsyncHelpers.RunSync[T](Func`1 task) in c:\Builds\RavenDB-Stable-3.0\Raven.Abstractions\Util\AsyncHelpers.cs:line 90
at Raven.Client.Connection.ServerClient.GetIndex(String name) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Connection\ServerClient.cs:line 223
at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Indexes\AbstractIndexCreationTask.cs:line 293
at Raven.Client.DocumentStoreBase.ExecuteIndex(AbstractIndexCreationTask indexCreationTask) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\DocumentStoreBase.cs:line 103
at Raven.Client.Indexes.IndexCreation.CreateIndexes(ExportProvider catalogToGetnIndexingTasksFrom, IDocumentStore documentStore) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Indexes\IndexCreation.cs:line 155
at Raven.Client.Indexes.IndexCreation.CreateIndexes(Assembly assemblyToScanForIndexingTasks, IDocumentStore documentStore) in c:\Builds\RavenDB-Stable-3.0\Raven.Client.Lightweight\Indexes\IndexCreation.cs:line 43
我不知道为什么这种情况发生和搜索没有产生任何关于这个特定错误的信息。
答案 0 :(得分:0)
事实证明,这是一个与RavenDB和Castle Windsor之间的互动有关的非常具体的问题。我在这里问了一个新问题:
How do I use Castle Windsor to create a RavenDB session with client version > 3.0.3660?