【发布时间】:2018-10-05 06:09:28
【问题描述】:
我有一个针对 .net 标准 1.4 的 Xamarin.Forms 应用程序。在最低版本为 14393(和目标为 16299)的 UWP 应用程序上,我从 Microsoft Store 获得以下异常(尽管在我的计算机上,即使从 appxbundle 文件运行良好):
注意要点:
- 错误发生在
Xamarin.Forms.Forms.Init(e);inOnLaunched。 - 错误本身是
Could not load file or assembly 'System.Private.CoreLib...'。
System.IO.FileNotFoundException:无法加载文件或程序集 'System.Private.CoreLib,版本=4.0.0.0,文化=中性, PublicKeyToken=b03f5f7f11d50a3a' 或其依赖项之一。这 系统找不到指定的文件。文件名: 'System.Private.CoreLib,版本=4.0.0.0,文化=中性, PublicKeyToken=b03f5f7f11d50a3a' 在 System.ModuleHandle.ResolveType(RuntimeModule 模块,Int32 typeToken,IntPtr* typeInstArgs,Int32 typeInstCount,IntPtr* methodInstArgs、Int32 methodInstCount、ObjectHandleOnStack 类型) 在 System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule 模块,Int32 typeToken,RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext) 在 System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken,Type[] genericTypeArguments,Type[] 通用方法参数) 在 System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord、MetadataImport 范围、Assembly 和 lastAptcaOkAssembly、 RuntimeModule 装饰模块,MetadataToken 装饰令牌, 运行时类型 属性过滤器类型,布尔型 mustBeInheritable,对象[] 属性、IList 派生属性、RuntimeType& 属性类型、IRuntimeMethodInfo& ctor、Boolean& ctorHasParameters、Boolean& isVarArg) 在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule 装饰模块,Int32 装饰元数据令牌,Int32 pcaCount, 运行时类型 attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent) 在 System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly 程序集,运行时类型 caType) 在 System.Reflection.RuntimeAssembly.GetCustomAttributes(类型 属性类型,布尔继承) 在 System.Attribute.GetCustomAttributes(程序集元素,类型 属性类型,布尔继承) 在 Xamarin.Forms.Internals.Registrar.RegisterAll(类型 [] 属性类型) 在 Xamarin.Forms.Forms.Init(IActivatedEventArgs launchActivatedEventArgs,IEnumerable`1 rendererAssemblies) 在 PasswordManager.UWP.App.d__1.MoveNext()
任何想法这可能意味着什么,以及如何解决它?
【问题讨论】:
-
您的应用程序是否使用桌面扩展组件,如果是,您是否使用 VS Packaging Project 来创建商店包?该错误表明您提交了一个无效的包。
-
@StefanWickMSFT 干得好!是的,确实,我有一个桌面扩展。但我没有使用打包项目创建项目,因为它不是 Centennial 应用程序。这是一个 Xamarin.Forms 应用程序。不过,我已经包含了一个 Win32 (Winforms) 应用程序,该应用程序使用
await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();从应用程序调用(不是在启动时,仅通过用户操作)。我已经获得百年团队的许可,Win32 exe在我的电脑上调用正常。
标签: c# xamarin uwp .net-standard desktop-bridge