我刚升级到单声道4.8.0。
在运行我的nancy应用程序时,我现在遇到了这个不合规定的错误:
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Something went wrong when trying to satisfy one of the dependencies during composition, make sure that you've registered all new dependencies in the container and inspect the innerexception for more details. ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.NancyEngine ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRequestDispatcher ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRouteResolver ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.RouteCache ---> System.NullReferenceException: Object reference not set to an instance of an object
它表示有一些依赖项没有正确注册。但是,通常情况下,这种伴随(在内部异常链中)伴随着依赖的指示无法得到解决。
现在它只是说Unable to resolve type: Nancy.NancyEngine
,这是一个我确定不应该为此修改的类。此外,在堆栈跟踪结束时(通常有关于哪个依赖项导致此问题的线索),它显示Unable to resolve type: Nancy.Routing.RouteCache ---> System.NullReferenceException: Object reference not set to an instance of an object
下面是完整的堆栈跟踪。我错过了什么?感谢您对此事的任何见解!
Stack overflow in unmanaged: IP: 0x1bec8c, fault addr: 0xbf767fec
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: Something went wrong when trying to satisfy one of the dependencies during composition, make sure that you've registered all new dependencies in the container and inspect the innerexception for more details. ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.NancyEngine ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRequestDispatcher ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.DefaultRouteResolver ---> Nancy.TinyIoc.TinyIoCResolutionException: Unable to resolve type: Nancy.Routing.RouteCache ---> System.NullReferenceException: Object reference not set to an instance of an object
at System.Exception..ctor (System.String message, System.Exception innerException) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCResolutionException..ctor (System.Type type, System.Exception innerException) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.<ResolveAllInternal>b__43 (Nancy.TinyIoc.TypeRegistration registration) in <filename unknown>:line 0
at System.Linq.Enumerable+WhereSelectEnumerableIterator`2[TSource,TResult].MoveNext () in <filename unknown>:line 0
at System.Linq.Enumerable+<CastIterator>c__Iterator17`1[TResult].MoveNext () in <filename unknown>:line 0
at Nancy.Routing.RouteCache.BuildCache (IEnumerable`1 modules) in <filename unknown>:line 0
at Nancy.Routing.RouteCache..ctor (INancyModuleCatalog moduleCatalog, INancyContextFactory contextFactory, IRouteSegmentExtractor routeSegmentExtractor, IRouteDescriptionProvider routeDescriptionProvider, ICultureService cultureService, IEnumerable`1 routeMetadataProviders) in <filename unknown>:line 0
at (wrapper dynamic-method) System.Object:lambda_method (System.Runtime.CompilerServices.Closure,object[])
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
--- End of inner exception stack trace ---
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ConstructType (System.Type requestedType, System.Type implementationType, System.Reflection.ConstructorInfo constructor, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer+SingletonFactory.GetObject (System.Type requestedType, Nancy.TinyIoc.TinyIoCContainer container, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
at Nancy.TinyIoc.TinyIoCContainer.ResolveInternal (Nancy.TinyIoc.TypeRegistration registration, Nancy.TinyIoc.NamedParameterOverloads parameters, Nancy.TinyIoc.ResolveOptions options) in <filename unknown>:line 0
--- End of inner exception stack trace ---
at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].SafeGetNancyEngineInstance () in <filename unknown>:line 0
at Nancy.Bootstrapper.NancyBootstrapperBase`1[TContainer].GetEngine () in <filename unknown>:line 0
at Nancy.Hosting.Self.NancyHost..ctor (INancyBootstrapper bootstrapper, Nancy.Hosting.Self.HostConfiguration configuration, System.Uri[] baseUris) in <filename unknown>:line 0
at Nancy.Hosting.Self.NancyHost..ctor (System.Uri[] baseUris) in <filename unknown>:line 0
at Reflect.Web.v2.MainClass.Main (System.String[] args) in <filename unknown>:line 0
答案 0 :(得分:0)
一直走向右边显示: 无法解析类型:Nancy.Routing.RouteCache ---&gt; System.NullReferenceException:未将对象引用设置为对象的实例 在System.Exception..ctor(System.String消息,System.Exception innerException)中:第0行
RouteCache通常会触发Nancy Modules的解析。 似乎在你的一个模块
的构造函数中存在NullReferenceException