在App.xaml.cs中调用基础构造函数(PrismApplication构造函数)时出错

问题描述 投票:1回答:1

我很欣赏以下的一些帮助..

我已经使用Prism Forms启动了Xamarin Forms应用程序。

我使用模板包在Visual Studio(Windows)中创建了项目。

该项目构建正常但是当我尝试在我的Mac上的模拟器中运行它时,一旦应用程序启动,我就会在调用PrismApplication类的基础构造函数时出错。请参阅下面的错误消息和堆栈跟踪。提前致谢。

包版本

  • Prism.Ninject.Forms版本:7.0.0.168-pre(也尝试过相同版本的Unity.Forms)
  • Xamarin.Forms版本:2.4.0.282

错误消息:此平台不支持操作

来源:System.Reflection.Emit.Lightweight

堆栈跟踪:

at System.Reflection.Emit.DynamicMethod..ctor(System.String name,System.Type returnType,System.Type [] parameterTypes,System.Boolean restrictedSkipVisibility)[0x00006] in <896ad3a163a543758d64d3128b003bfb>:0 in Ninject.Injection.DynamicMethodInjectorFactory。在(Ninject.Planning.Strategies.ConstructorReflectionStrategy.Execute(Ninject.Planning.IPlan plan)[0x0005c] in:0中的Ninject.Planning.Planner + <> c__DisplayClass9_0.b__0中创建(System.Reflection.ConstructorInfo构造函数)[0x00005]:0 (Ninject.Planning.Strategies.IPlanningStrategy s)[0x00000] in:0 at Ninject.Infrastructure.Language.ExtensionsForIEnumerableOfT.Map [T](System.Collections.Generic.IEnumerable1[T] series, System.Action1 [T] action)[0x00010] in:0 at Ninject .Planning.Planner.CreateNewPlan(System.Type type)[0x00053] in:0 in Ninject.Planning.Planner.GetPlan(System.Type type)[0x00026] in:0 at Ninject.Activation.Providers.StandardProvider.Create(Ninject .Activation.IContext context)[0x00053] in:0 at Ninject.Activation.Conte xt.ResolveInternal(System.Object scope)[0x00034] in:0 in Ninject.Activation.Context.Resolve()[0x00073] in:0 at Ninject.KernelBase.Resolve(Ninject.Activation.IRequest request,System.Boolean handleMissingBindings) [0x00144] in:0,Ninject.KernelBase.Resolve(Ninject.Activation.IRequest请求)[0x00000] in:0,Ninject.ResolutionExtensions.GetResolutionIterator(Ninject.Syntax.IResolutionRoot root,System.Type service,System.Func2[T,TResult] constraint, System.Collections.Generic.IEnumerable1 [T ]参数,System.Boolean isOptional,System.Boolean isUnique)[0x0002f] in:0 at Ninject.ResolutionExtensions.Get [T](Ninject.Syntax.IResolutionRoot root,System.String name,Ninject.Parameters.IParameter [] parameters) [0x0000d] in:0,Prism.Ninject.PrismApplication.CreateNavigationService()[0x00010] in:0 at Prism.PrismApplicationBase1[T].Initialize () [0x0004d] in <ec44a08008f44d76a60fa1415f8ba03b>:0 at Prism.PrismApplicationBase1 [T] .InitializeInternal()[0x00006] in:0 at Prism.PrismApplicationBase1[T]..ctor (Prism.IPlatformInitializer1 [T] initializer)[0x00031 ] in:0在Prism.Ninject.PrismApplication.get_Logger()[0x00000] in:0 at MyProjec t.App..ctor(Prism.Ninject.IPlatformInitializer初始化程序)[0x00000]位于/Prosers/Tomas/Projects/MyProject/MyProject/MyProject/App.xaml.cs:23,位于MyProject.iOS.AppDelegate.FinishedLaunching(UIKit.UIApplication) app,Foundation.NSDictionary选项)[0x00007]在/Users/Tomas/Projects/MyProject/MyProject/MyProject.iOS/AppDelegate.cs:24 at(包装器托管到原生)UIKit.UIApplication:UIApplicationMain(int,string [在/ Users / builder / data / lanes / 5489 / c4240f3f / source / xamarin中的UIKit.UIApplication.Main(System.String [] args,System.IntPtr principal,System.IntPtr委托)[0x00005]中的],intptr,intptr) -macios / src / UIKit / UIApplication.cs:79位于/ Users / builder / data / lanes / 5489中的UIKit.UIApplication.Main(System.String [] args,System.String principalClassName,System.String delegateClassName)[0x00038]位于/ Users / Tomas / Projects / MyProject / MyProject / MyProject的MyProject.iOS.Application.Main(System.String [] args)[0x00001] /c4240f3f/source/xamarin-macios/src/UIKit/UIApplication.cs:63 .IOS / Main.cs:17

xamarin.forms prism
1个回答
0
投票

虽然我不确定是什么导致了你在这里注意到的异常,但这确实导致在Prism.Ninject.Forms的Prism 7预览5中发现了许多问题,特别是围绕ContainerExtension。这些问题现已得到修复,可从MyGet上的7.0.0.340-ci版开始提供。

© www.soinside.com 2019 - 2024. All rights reserved.