我正在使用 MvvmCross 框架来交付使用 Xamarin 的跨平台应用程序。我的 Windows Phone 应用程序在 WP8 平台下完全可以正常工作,在 WP7 平台下失败并出现内部错误。我正在为 WP7 和 WP8 平台使用单个 Visual Studio 项目(WP7 模板)。
var setup = new Setup(RootFrame);
setup.Initialize();
这里是详细的堆栈跟踪:
System.InvalidProgramException was unhandled
Message=InvalidProgramException
StackTrace:
at System.RuntimeType.GetConstructors(BindingFlags bindingAttr)
at Cirrious.CrossCore.IoC.MvxTypeExtensions.<CreatableTypes>b__1(Type t)
at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext()
at System.Linq.Enumerable.<WhereIterator>d__0`1.MoveNext()
at Cirrious.CrossCore.Platform.MvxBootstrapRunner.Run(Assembly assembly)
at Cirrious.MvvmCross.Platform.MvxSetup.PerformBootstrapActions()
at Cirrious.MvvmCross.Platform.MvxSetup.InitializeSecondary()
at Cirrious.MvvmCross.Platform.MvxSetup.Initialize()
at MyApp.WP.App..ctor()
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(RuntimeConstructorInfo rtci, BindingFlags invokeAttr, Binder binder, Object parameters, CultureInfo culture, Boolean isBinderDefault, Assembly caller, Boolean verifyAccess, StackCrawlMark& stackMark)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, StackCrawlMark& stackMark)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at MS.Internal.TypeProxy.<>c__DisplayClass30.<GetCreateObjectDelegate>b__2a()
at MS.Internal.TypeProxy.CreateInstance(UInt32 customTypeId)
at MS.Internal.FrameworkCallbacks.CreateKnownObject(IntPtr nativeRootPeer, UInt32 customTypeId, String initializationString, IntPtr& nativePeer, UInt32 isCreatedByParser)
at MS.Internal.FrameworkCallbacks.CreateUnknownObject(String assemblyName, String typeName, IntPtr nativeRootPeer, String initializationString, UInt32& customTypeId, UInt32& coreTypeId, UInt32& typeFlags, IntPtr& nativePeer)
任何想法如何诊断和解决问题?