我一直在开发Xamarin表单应用程序,但似乎无法在启用.Net本机工具链的发布模式下构建UWP版本。 尝试编译时,我在生成日志中收到以下错误消息:
C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : System.NotSupportedException: Cannot deserialize type 'Xamarin.Forms.VisualElement' because it contains property 'Bounds' which has no public setter.
剩余的堆栈跟踪:
C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.TypeDesc.CheckSupported()
C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.TypeScope.GetTypeDesc(Type type, MemberInfo source, Boolean directReference, Boolean throwOnError)
C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.ReflectionAwareCodeGen.WriteReflectionInit(TypeScope scope) C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.XmlSerializationWriterCodeGen.GenerateBegin() C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Hashtable assemblies, String outputDir, IEnumerable'1 referenceDirectories, String intermediateDir, Boolean loadAssembly) C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.XmlSerializer.GenerateSerializer(Type[] types, XmlMapping[] mappings, CompilerParameters parameters, String outputDir, IEnumerable'1 referenceDirectories, String intermediateDir, Boolean loadAssembly) C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at System.Xml.Serialization.XmlSerializer.GenerateSerializer(Type[] types, String outputDir, IEnumerable'1 referenceDirectories, String intermediateDir, List'1 wcfSerializers, Boolean loadAssembly) C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : at SerializationAssemblyGenerator.Program.Main(String[] args) Generating System.Reflection.DispatchProxy proxy code. C:\Users\dherring\.nuget\packages\microsoft.net.native.compiler\1.7.1\tools\Microsoft.NetNative.targets(697,5): error : ILT0032: Failed to compile serialization code. See the build log for error details.
由于其他限制,我在类库中使用了Visual Studio 2017(15.7.6)和.NetStandard 1.4,因此,我只能使用Xamarin.Forms版本2.5.1.527436,这是什么?引用。
我已经查看了UWP Default.rd.xml文件,但似乎没有收听吗?
<Namespace Name="Xamarin.Forms.VisualElement" Serialize="Excluded" Browse="Excluded" Activate="Excluded" Dynamic="Excluded" XmlSerializer="Excluded" />
和
<Type Name="Xamarin.Forms.VisualElement" Serialize="Auto">
<Property Name="Bounds" Serialize="Excluded" Browse="Excluded" Dynamic="Excluded" />
</Type>
任何帮助将不胜感激。