unitycontainer / aspnet-mvc

ASP.NET MVC 5 Adapter
Apache License 2.0
13 stars 10 forks source link

Debug mode error in debug, to find UnityContainer.cs #4

Closed ghd258 closed 7 years ago

ghd258 commented 7 years ago

Unity.Exceptions.ResolutionFailedException:“Resolution of the dependency failed, type = 'System.Web.Mvc.ITempDataProviderFactory', name = '(none)'. Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, System.Web.Mvc.ITempDataProviderFactory, is an interface and cannot be constructed. Are you missing a type mapping?

At the time of the exception, the container was: Resolving System.Web.Mvc.ITempDataProviderFactory,(none)

ghd258 commented 7 years ago

发生了 Unity.Exceptions.ResolutionFailedException HResult=0x80131500 Message=Resolution of the dependency failed, type = 'System.Web.Mvc.ITempDataProviderFactory', name = '(none)'. Exception occurred while: while resolving. Exception is: InvalidOperationException - The current type, System.Web.Mvc.ITempDataProviderFactory, is an interface and cannot be constructed. Are you missing a type mapping?

At the time of the exception, the container was: Resolving System.Web.Mvc.ITempDataProviderFactory,(none)

Source=<无法计算异常源> StackTrace: 在 Unity.UnityContainer.BuildUp(Type typeToBuild, Object existing, String name, ResolverOverride[] resolverOverrides) 在 C:\projects\unity\Container\src\UnityContainer.cs 中: 第 215 行 在 Unity.UnityContainer.Resolve(Type type, String name, ResolverOverride[] resolverOverrides) 在 C:\projects\unity\Container\src\UnityContainer.cs 中: 第 163 行 在 Unity.UnityContainerExtensions.Resolve(IUnityContainer container, Type t, ResolverOverride[] overrides) 在 Unity.Mvc.UnityDependencyResolver.GetService(Type serviceType)

内部异常 1: InvalidOperationException: The current type, System.Web.Mvc.ITempDataProviderFactory, is an interface and cannot be constructed. Are you missing a type mapping?

axelgenus commented 7 years ago

I am working on this.

axelgenus commented 7 years ago

Can you please post your code? How are you initializing Unity?

ENikS commented 7 years ago

I am guessing it is no longer relevant