我的团队前段时间尝试过使用Castle Windsor(3.2.0)来获得IoC的好处.我们在开发盒上运行的试验很顺利,但是当我们尝试在生产服务器上运行代码时,它失败并出现以下异常
Application: XXXX
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at System.Signature.GetSignature(Void*, Int32, System.RuntimeFieldHandleInternal, System.IRuntimeMethodInfo, System.RuntimeType)
at System.Reflection.RuntimeMethodInfo.get_Signature()
at System.Reflection.RuntimeMethodInfo.GetParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParametersNoCopy()
at System.Reflection.RuntimePropertyInfo.GetIndexParameters()
at Castle.MicroKernel.ModelBuilder.Inspectors.PropertiesDependenciesModelInspector.IsValidPropertyDependency(System.Reflection.PropertyInfo)
at System.Linq.Enumerable+WhereArrayIterator`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].MoveNext()
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]..ctor(System.Collections.Generic.IEnumerable`1<System.__Canon>)
at System.Linq.Enumerable.ToList[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]](System.Collections.Generic.IEnumerable`1<System.__Canon>)
at Castle.MicroKernel.ModelBuilder.Inspectors.PropertiesDependenciesModelInspector.InspectProperties(Castle.Core.ComponentModel)
at System.Collections.Generic.List`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].ForEach(System.Action`1<System.__Canon>)
at Castle.MicroKernel.ModelBuilder.DefaultComponentModelBuilder.BuildModel(Castle.MicroKernel.ModelBuilder.IComponentModelDescriptor[])
at Castle.MicroKernel.Registration.ComponentRegistration`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].Castle.MicroKernel.Registration.IRegistration.Register(Castle.MicroKernel.IKernelInternal)
at Castle.MicroKernel.DefaultKernel.Register(Castle.MicroKernel.Registration.IRegistration[])
at Castle.Windsor.WindsorContainer.Register(Castle.MicroKernel.Registration.IRegistration[])
at Sproom.Web.Infrastructure.WindsorInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.Installer.AssemblyInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.Installer.CompositeInstaller.Install(Castle.Windsor.IWindsorContainer, Castle.MicroKernel.SubSystems.Configuration.IConfigurationStore)
at Castle.Windsor.WindsorContainer.Install(Castle.MicroKernel.Registration.IWindsorInstaller[], Castle.Windsor.Installer.DefaultComponentInstaller)
at Castle.Windsor.WindsorContainer.Install(Castle.MicroKernel.Registration.IWindsorInstaller[])
Run Code Online (Sandbox Code Playgroud)
这对我们来说是一个显而易见的事实,并且证明谷歌很难.我最近有时间抛出这个问题,并成功地将其调试到一个组件在MVC 3 dll上具有显式引用/依赖(C#,而不是windsor)这一事实.服务器是新委托的,只安装了MVC 4.所有开发盒都安装了MVC 3,使问题只能在生产中重现.
我通过二进制注释组件注册代码,将批量注册转换为每个组件注册,然后盯着有问题的组件,直到我点击正确的位置并且有一个顿悟来调试它.
我现在的问题是,有没有更好的方法可以调试它?我可以让温莎提供更好的信息吗?为什么温莎不是正常的非温莎情况下这是一个问题呢?我和团队现在对使用Windsor有点怀疑,因为非可擦除错误的讨厌只能在生产中重现,所以我希望我错过了解决这个问题的一些好方法.
| 归档时间: |
|
| 查看次数: |
1223 次 |
| 最近记录: |