便携式数据注释在UWP项目

时间:2016-12-09 18:16:33

标签: xamarin windows-phone uwp xamarin.forms xamarin.uwp

ITNOA

大家好,

我在Xamarin表单中使用portable data annotations,当我部署UWP项目并运行它时,我抓住了MissingManifestResourceException下面添加的例外细节),同时我添加了便携式数据注释PCL项目和UWP项目都是。

我尝试Net46-Portable.DataAnnotations Portable-Strong.DataAnnotations但不再有效。

我哪里错了?

  • 我的UWP项目目标版本Windows 10周年纪念版(10.0; Build 14393)
  • 我的UWP项目最低版本Windows 10(10.0; Build 10586)
  • 我的手机我测试的是Windows手机10周年纪念版。
  • Xamarin表单版本为2.3.4.171-pre1

由于

System.Resources.MissingManifestResourceException occurred
  HResult=-2146233038
  Message=Unable to load resources for resource file "System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources" in package "ResaDoctorApp".
  Source=mscorlib
  StackTrace:
       at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)
       at System.ComponentModel.DataAnnotations.Resources.DataAnnotationsResources.get_EmailAddressAttribute_Invalid()
       at System.ComponentModel.DataAnnotations.EmailAddressAttribute..ctor()
       at System.RuntimeTypeHandle.CreateCaInstance(RuntimeType type, IRuntimeMethodInfo ctor)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
       at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
       at System.Reflection.RuntimePropertyInfo.GetCustomAttributes(Type attributeType, Boolean inherit)
       at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)
       at System.Attribute.GetCustomAttributes(MemberInfo element, Boolean inherit)
       at System.Reflection.CustomAttributeExtensions.GetCustomAttributes(MemberInfo element, Boolean inherit)
       at AutoMapper.Configuration.MappingExpression`2.Configure(IProfileConfiguration profile, TypeMap typeMap)
       at AutoMapper.Profile.BuildTypeMap(TypeMapRegistry typeMapRegistry, ITypeMapConfiguration config)
       at AutoMapper.Profile.AutoMapper.IProfileConfiguration.Register(TypeMapRegistry typeMapRegistry)
       at AutoMapper.MapperConfiguration.Seal(IConfiguration configuration)
       at AutoMapper.MapperConfiguration..ctor(MapperConfigurationExpression configurationExpression, IEnumerable`1 mappers)
       at AutoMapper.Mapper.Initialize(Action`1 config)
       at DoctorApp.Models.Doctor.FillFromFather(DoctorPreview preview)
  InnerException: 

0 个答案:

没有答案