Xamarin Forms: iOS 链接框架

3
我有一个准备好提交给苹果公司进行审核的应用程序。除了当我将其发送到App Store Connect 时,我会收到一封电子邮件说它太大之外,一切都正常。
经过一些研究,我发现,基本上最后的办法是改变链接器行为。我原来设置为不链接,一切都正常,但文件太大约68.4MB。当我将其更改为仅链接Framework SDKs时,应用程序可以运行,但我无法通过登录页面,因为我遇到了错误,尽管它确实连接到数据库。
这是我得到的错误:
The type initializer for 'Microsoft.EntityFrameworkCore.SqlServer.Query.ExpressionTranslators.Internal.SqlServerCompositeMethodCallTranslator' threw an exception.

以下是内部异常:

Value cannot be null.
Parameter name: key

如果您能使用它,这是堆栈跟踪:

  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:661 
--- End of stack trace from previous location where exception was thrown ---
  at (wrapper managed-to-native) System.Reflection.MonoCMethod.InternalInvoke(System.Reflection.MonoCMethod,object,object[],System.Exception&)
  at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Library/Frameworks/Xamarin.iOS.framework/Versions/11.14.0.14/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/MonoMethod.cs:661 
--- End of stack trace from previous location where exception was thrown ---
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x00065] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton (Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0000d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00072] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton (Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0000d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00072] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton (Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0000d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00072] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton (Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0000d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00072] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitSingleton (Microsoft.Extensions.DependencyInjection.ServiceLookup.SingletonCallSite singletonCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0000d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00072] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor (Microsoft.Extensions.DependencyInjection.ServiceLookup.ConstructorCallSite constructorCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0001b] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00056] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScoped (Microsoft.Extensions.DependencyInjection.ServiceLookup.ScopedCallSite scopedCallSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0002d] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2[TArgument,TResult].VisitCallSite (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, TArgument argument) [0x00080] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve (Microsoft.Extensions.DependencyInjection.ServiceLookup.IServiceCallSite callSite, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x00000] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine+<>c__DisplayClass1_0.<RealizeService>b__0 (Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope scope) [0x0003e] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService (System.Type serviceType, Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope serviceProviderEngineScope) [0x00032] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService (System.Type serviceType) [0x00013] in <286bee37a82942dd9a9ac759189d96e2>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService (System.IServiceProvider provider, System.Type serviceType) [0x00034] in <e923201aa4e848f9b00b0bc074d511ff>:0 
  at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T] (System.IServiceProvider provider) [0x0000e] in <e923201aa4e848f9b00b0bc074d511ff>:0 
  at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies () [0x00008] in D:\Visual Studio Programs\Training\Class Library\EntityFrameworkCore-release-2.2\EntityFrameworkCore-release-2.2\src\EFCore\DbContext.cs:330 
  at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider () [0x000dd] in D:\Visual Studio Programs\Training\Class Library\EntityFrameworkCore-release-2.2\EntityFrameworkCore-release-2.2\src\EFCore\DbContext.cs:312 
  at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies () [0x00008] in D:\Visual Studio Programs\Training\Class Library\EntityFrameworkCore-release-2.2\EntityFrameworkCore-release-2.2\src\EFCore\DbContext.cs:330 
  at Microsoft.EntityFrameworkCore.DbContext.get_Model () [0x00000] in D:\Visual Studio Programs\Training\Class Library\EntityFrameworkCore-release-2.2\EntityFrameworkCore-release-2.2\src\EFCore\DbContext.cs:138 
  at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].get_EntityType () [0x0001b] in <e87c0bc6b254447dbdf8d9b8988dec1b>:0 
  at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].CheckState () [0x00001] in <e87c0bc6b254447dbdf8d9b8988dec1b>:0 
  at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].get_EntityQueryable () [0x00001] in <e87c0bc6b254447dbdf8d9b8988dec1b>:0 
  at Microsoft.EntityFrameworkCore.Internal.InternalDbSet`1[TEntity].System.Linq.IQueryable.get_Provider () [0x00000] in <e87c0bc6b254447dbdf8d9b8988dec1b>:0 
  at System.Linq.Queryable.Where[TSource] (System.Linq.IQueryable`1[T] source, System.Linq.Expressions.Expression`1[TDelegate] predicate) [0x0001c] in <4aed07645cc84858a0e66663540f2bae>:0 
  at PDDataNetStandard.Repositories.UserRepository.GetByInstallUserNameAndPassword (System.String username, System.String password) [0x00015] in D:\Visual Studio Programs\PDPublished\PDDataNetStandard\PDDataNetStandard\PDDataNetStandard\PDDataNetStandard\Repositories\Repository.cs:87 
  at PDInstall.Views.LoginPage.LoginPDInstall () [0x00041] in D:\Visual Studio Programs\PDPublished\PDInstall\Main\PDInstall\PDInstall\PDInstall\Views\LoginPage.xaml.cs:62 

如何让我的应用程序运行起来?

编辑

我已经添加了linkskip,但似乎没有什么作用,除非我做错了什么?

--linkskip=Microsoft.EntityFrameworkCore.SqlServer.Query.ExpressionTranslators.Internal.SqlServerCompositeMethodCallTranslator

1
你可以告诉链接器跳过那个程序集:https://learn.microsoft.com/en-us/xamarin/ios/deploy-test/linker?tabs=vsmac#skipping-assemblies - Andrew
根据Andrew的建议,关于这个问题,EF开了一个问题,并提出了一种解决方案,以防止链接器剥离库的一部分。可以在此处查看该问题(https://github.com/aspnet/EntityFrameworkCore/issues/10963#issuecomment-375837164),并可以在此处下载他们创建的示例应用程序(https://github.com/cwrea/XamarinTodo/)。 - pinedax
谢谢你们两个的回复,不幸的是这两件事都没有起作用,除非我没有正确添加LinkDescription或linkskip。据我所知,LinkDescription只是一个可以创建并放入我的解决方案中的文件,除非还有其他需要做的事情。 - DalTron
没事了!我刚刚将 System.Core 和 mscorlib 添加到 linkskip 中,现在可以工作了!谢谢你们两个! - DalTron
很高兴它起作用了。请随意回答您解决问题的详细步骤,以便任何搜索相同问题的人都可以轻松找到答案。 - Andrew
1个回答

1
感谢@Andrew和@apineda帮助我解决了这个问题。
最终,我只需在我的mtouch参数中添加两个东西。
--linkskip=System.Core --linkskip=mscorlib

这个没问题!


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接