-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.PlatformNotSupportedException with UWP and .Net Native #269
Comments
Doh, sorry about that @gr001! Looks like this is an issue with I have opened an issue on LightInject's board. Feel free to follow along here: |
Alright @gr001 I took advantage of our new repo here to update our dependency to You can get the latest version from our new preview feed here: https://ci.appveyor.com/nuget/extendedxmlserializer-preview (Please be sure to enable |
Uau. It was fast!. Thanks a lot. I will give it a try asap.
Jiri
From: Mike-EEE <notifications@github.com>
Sent: Saturday, November 9, 2019 8:52 AM
To: ExtendedXmlSerializer/ExtendedXmlSerializer <ExtendedXmlSerializer@noreply.github.com>
Cc: JK <jkralik74@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [ExtendedXmlSerializer/ExtendedXmlSerializer] System.PlatformNotSupportedException with UWP and .Net Native (#269)
Alright @gr001<https://github.com/gr001> I took advantage of our new repo here to update our dependency to LightInject rather than LightInject.Source. That should properly load all its UWP functionality and rule out anything on our side that might be causing it.
You can get the latest version from our new preview feed here:
https://ci.appveyor.com/nuget/extendedxmlserializer-preview
(Please be sure to enable Include prerelease in Nuget explorer.)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#269>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGWXDX5YKIJGSCGIB6IMB5TQSZT3BANCNFSM4JJX3AOQ>.
|
If you are refering to the version 2.1.24 then I am still getting the same PlatformNotSupportedException with the same callstack. I cannot see any other available version even when I check 'include prerelease' in VS. |
Ugh, you're right @gr001 sorry about that! We've been doing a bunch of housecleaning and catching up with our deployments. Fixing some things and breaking others. I will look into the nuget, but for now you can download the current If for some reason a new version gets deployed and that one is not available, you can download the latest from here: https://ci.appveyor.com/project/ExtendedXmlSerializer/extendedxmlserializer/build/artifacts You should be able to put them in your Visual Studio Offline Packages (or create your own) in the Visual Studio Package sources: |
Looking into this now. There will be further deployments so I am attaching ExtendedXmlSerializer.2.1.25.488-preview.zip You can also monitor the following for the latest, as well: https://ci.appveyor.com/project/ExtendedXmlSerializer/extendedxmlserializer/build/artifacts/ |
Boh @gr001 in my case the issue was simple. I had Let me know if you still cannot see the package after accounting for the above. |
I have tried this preview version. The good thing is that I can create a serializer in UWP with .Net Native turned on and I do not get a platform not supported exception. The bad thing is when I try to serialize a simple class I get 'System.InvalidOperationException' in System.Private.Reflection.Core.dll.
Thanks again.
J
Exception callstack:
at System.Reflection.Runtime.PropertyInfos.NativeFormat.NativeFormatRuntimePropertyInfo.get_MetadataToken() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\PropertyInfos\NativeFormat\NativeFormatRuntimePropertyInfo.cs:line 126
at ExtendedXmlSerializer.ExtensionModel.Xml.DefaultMemberOrder.Get(MemberInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\Xml\DefaultMemberOrder.cs:line 12
at ExtendedXmlSerializer.ContentModel.Members.MemberOrder.Create(MemberInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\MemberOrder.cs:line 19
at ExtendedXmlSerializer.Core.Sources.StructureCacheBase`2.CreateStructure(TKey parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\StructureCacheBase.cs:line 17
at System.Runtime.CompilerServices.ConditionalWeakTable`2.CreateValueCallback.Invoke(TKey key)
at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValueLocked(TKey key, CreateValueCallback createValueCallback) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs:line 200
at System.Runtime.CompilerServices.ConditionalWeakTable`2.GetValue(TKey key, CreateValueCallback createValueCallback) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs:line 191
at ExtendedXmlSerializer.Core.Sources.StructureCacheBase`2.Get(TKey key) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\StructureCacheBase.cs:line 21
at ExtendedXmlSerializer.ContentModel.Members.Members.Get(MemberDescriptor parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\Members.cs:line 17
at ExtendedXmlSerializer.ContentModel.Members.TypeMemberSource.<Get>d__5.MoveNext() in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\TypeMemberSource.cs:line 35
at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext() in E:\A\_work\345\s\corefx\src\System.Linq\src\System\Linq\Where.cs:line 117
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source, Int32& length)
at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__3.MoveNext()
at System.Collections.Generic.LargeArrayBuilder`1.AddRange(IEnumerable`1 items) in E:\A\_work\345\s\corefx\src\Common\src\System\Collections\Generic\LargeArrayBuilder.SizeOpt.cs:line 33
at System.Collections.Generic.EnumerableHelpers.ToArray[T](IEnumerable`1 source) in E:\A\_work\345\s\corefx\src\Common\src\System\Collections\Generic\EnumerableHelpers.cs:line 84
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source) in E:\A\_work\345\s\corefx\src\System.Linq\src\System\Linq\ToCollection.cs:line 18
at System.Collections.Immutable.ImmutableArray.CreateRange[T](IEnumerable`1 items)
at System.Collections.Immutable.ImmutableArray.ToImmutableArray[TSource](IEnumerable`1 items)
at ExtendedXmlSerializer.ContentModel.Members.TypeMembers.Create(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\TypeMembers.cs:line 27
at System.Func`2.Invoke(T arg)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ExtendedXmlSerializer.Core.Sources.CacheBase`2.Get(TKey key) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\CacheBase.cs:line 29
at ExtendedXmlSerializer.ContentModel.Members.MemberSerializations.Create(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\MemberSerializations.cs:line 31
at System.Func`2.Invoke(T arg)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ExtendedXmlSerializer.Core.Sources.CacheBase`2.Get(TKey key) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\CacheBase.cs:line 29
at ExtendedXmlSerializer.ContentModel.Members.InstanceMemberSerialization..ctor(TypeInfo type, IMemberSerializations serializations) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\InstanceMemberSerialization.cs:line 14
at ExtendedXmlSerializer.ContentModel.Members.InstanceMemberSerializations.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\InstanceMemberSerializations.cs:line 23
at ExtendedXmlSerializer.ContentModel.Members.MemberedContents.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Members\MemberedContents.cs:line 19
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 41
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.ConditionalSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\ConditionalSource.cs:line 48
at ExtendedXmlSerializer.ContentModel.Content.RecursionAwareContents.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Content\RecursionAwareContents.cs:line 21
at ExtendedXmlSerializer.ExtensionModel.Xml.CustomSerializationExtension.Contents.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\Xml\CustomSerializationExtension.cs:line 66
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.Cache`2.Create(TKey parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\Cache.cs:line 21
at System.Func`2.Invoke(T arg)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ExtendedXmlSerializer.Core.Sources.CacheBase`2.Get(TKey key) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\CacheBase.cs:line 29
at ExtendedXmlSerializer.ExtensionModel.References.DeferredContents.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\References\DeferredContents.cs:line 14
at ExtendedXmlSerializer.ContentModel.Content.Serializers.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ContentModel\Content\Serializers.cs:line 19
at ExtendedXmlSerializer.Core.Sources.CoercedParameter`3.Get(TFrom parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\CoercedParameter.cs:line 14
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.DelegatedSource`2.Get(TParameter parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\DelegatedSource.cs:line 20
at ExtendedXmlSerializer.ExtensionModel.References.ReferenceAwareSerializers.Get(TypeInfo parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\References\ReferenceAwareSerializers.cs:line 35
at System.Func`2.Invoke(T arg)
at ExtendedXmlSerializer.Core.Sources.Cache`2.Create(TKey parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\Cache.cs:line 21
at System.Func`2.Invoke(T arg)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at ExtendedXmlSerializer.Core.Sources.CacheBase`2.Get(TKey key) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Sources\CacheBase.cs:line 29
at ExtendedXmlSerializer.Write`1.Execute(Writing`1 parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Write.cs:line 20
at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969
at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, CallConversionParameters& conversionParams)
at Internal.Runtime.Augments.RuntimeAugments.RawCalliHelper.Call[T](IntPtr pfn, Void* arg1, T& arg2)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context, ConservativelyReportedRegionDesc& regionDesc)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context)
at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId)
at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969
at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, CallConversionParameters& conversionParams)
at Internal.Runtime.Augments.RuntimeAugments.RawCalliHelper.Call[T](IntPtr pfn, Void* arg1, T& arg2)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context, ConservativelyReportedRegionDesc& regionDesc)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context)
at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId)
at ExtendedXmlSerializer.Serializer`2.Serialize(TWrite writer, Object instance) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Serializer.cs:line 18
at Internal.Runtime.Augments.RuntimeAugments.CallDescrWorker(IntPtr callDescr) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\Internal\Runtime\Augments\RuntimeAugments.cs:line 969
at Internal.Runtime.TypeLoader.CallConverterThunk.InvokeTarget(Void* allocatedStackBuffer, CallConversionParameters& conversionParams)
at Internal.Runtime.Augments.RuntimeAugments.RawCalliHelper.Call[T](IntPtr pfn, Void* arg1, T& arg2)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBufferInternal[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context, ConservativelyReportedRegionDesc& regionDesc)
at Internal.Runtime.Augments.RuntimeAugments.RunFunctionWithConservativelyReportedBuffer[T](Int32 cbBuffer, IntPtr pfnTargetToInvoke, T& context)
at Internal.Runtime.TypeLoader.CallConverterThunk.CallConversionThunk(IntPtr callerTransitionBlockParam, IntPtr callConversionId)
at ExtendedXmlSerializer.ExtensionModel.Xml.ExtendedXmlSerializer.Serialize(XmlWriter writer, Object instance) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\Xml\ExtendedXmlSerializer.cs:line 17
at ExtendedXmlSerializer.ExtensionModel.Xml.InstanceFormatter.Get(Object parameter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\Xml\InstanceFormatter.cs:line 32
at ExtendedXmlSerializer.ExtensionMethods.Serialize(IExtendedXmlSerializer this, IXmlWriterFactory factory, Func`1 stream, Object instance) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionMethods.ExtensionModel.Xml.cs:line 267
at ExtendedXmlSerializer.ExtensionMethods.Serialize(IExtendedXmlSerializer this, Stream stream, Object instance) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionMethods.ExtensionModel.Xml.cs:line 259
at TestSerializer.MainPage.Button_Click(Object sender, RoutedEventArgs e) in C:\Projects\tests\TestSerializer\TestSerializer\MainPage.xaml.cs:line 54
From: Mike-EEE <notifications@github.com>
Sent: Monday, November 11, 2019 10:48 AM
To: ExtendedXmlSerializer/ExtendedXmlSerializer <ExtendedXmlSerializer@noreply.github.com>
Cc: JK <jkralik74@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [ExtendedXmlSerializer/ExtendedXmlSerializer] System.PlatformNotSupportedException with UWP and .Net Native (#269)
Looking into this now. There will be further deployments so I am attaching 2.1.25.488-preview to this post.
ExtendedXmlSerializer.2.1.25.488-preview.zip<https://github.com/ExtendedXmlSerializer/ExtendedXmlSerializer/files/3830676/ExtendedXmlSerializer.2.1.25.488-preview.zip>
You can also monitor the following for the latest, as well:
https://ci.appveyor.com/project/ExtendedXmlSerializer/extendedxmlserializer/build/artifacts/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#269>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGWXDX2U6KL6EDMCE5WCBD3QTES3PANCNFSM4JJX3AOQ>.
|
BOOOOOOOOOOOOO. :P I HATE UWPPPPPPPPPPPPPPPPPPPP lololol. Looks like it's having problems with the metadata token. What does the error message say? I'm really trying to stay away from having to spend half of my day installing UWP to try to figure this out. :P |
The exception message is ‘There is no metadata token available for the given member.’
J
From: Mike-EEE <notifications@github.com>
Sent: Wednesday, November 13, 2019 10:21 AM
To: ExtendedXmlSerializer/ExtendedXmlSerializer <ExtendedXmlSerializer@noreply.github.com>
Cc: JK <jkralik74@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [ExtendedXmlSerializer/ExtendedXmlSerializer] System.PlatformNotSupportedException with UWP and .Net Native (#269)
BOOOOOOOOOOOOO. :P I HATE UWPPPPPPPPPPPPPPPPPPPP lololol.
Looks like it's having problems with the metadata token. What does the error message say?
I'm really trying to stay away from having to spend half of my day installing UWP to try to figure this out. :P
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#269>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGWXDX3OUQ3MDE3IW27DPRTQTPBGFANCNFSM4JJX3AOQ>.
|
What on earth... are you using the latest version of UWP? 😁 A search on that error message turns up nothing. In fact, the only thing I can find is its resource registration: What about the class you are serializing? Are you able to paste it here? I didn't see anything obvious in the zip file. |
Oh, the other recommendation I have is to call |
Still the same. EnableMemberExceptionHandling did not have any effect.
I am using the latest VS + targeting Windows 1903 which should be ok. I also enabled ‘dynamic code generation’ in the application manifest. But still nothing…
I am attaching the updated project where I do a serialization of a simple class to a memory stream.
Thanks.
J
From: Mike-EEE <notifications@github.com>
Sent: Wednesday, November 13, 2019 10:54 AM
To: ExtendedXmlSerializer/ExtendedXmlSerializer <ExtendedXmlSerializer@noreply.github.com>
Cc: JK <jkralik74@hotmail.com>; Mention <mention@noreply.github.com>
Subject: Re: [ExtendedXmlSerializer/ExtendedXmlSerializer] System.PlatformNotSupportedException with UWP and .Net Native (#269)
Oh, the other recommendation I have is to call EnableMemberExceptionHandling on the ConfigurationContainer. It should tell you the member it is occurring on.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#269>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AGWXDX6HIQDRNE4KCOZM4I3QTPFDBANCNFSM4JJX3AOQ>.
|
Ah to be sure, Also, I don't seem to see the attachment, unfortunately. Also, feel free to post it as a repo under your account here on GitHub and I can take a look there as well. Repos are preferred as .zip files can contain security threats (unbeknownst to you). |
Yeah this seems like an UWP-specific issue when building in Confirming that we are able to run this in |
Interesting to note that this resource states that a https://docs.microsoft.com/en-us/dotnet/framework/net-native/reflection-and-net-native |
Alright, this has been deployed to the latest nugetz here: Further details of the release can be found here: If you run into any additional problems please open a new issue and we'll take a look into it. Thank you for your contributions towards improving ExtendedXmlSerializer!
|
I'm a little late to the party and this seems like it's been resolved... ? I'm happy to take a look at UWP stuff (I work on the .NET team) if you see more stuff like this. Let me know. |
I have just upgraded to the latest version and it looks promissing. Thanks a lot for this fix. We rely on this serializer as a replacement of MS serializer which has some crucial limitations when used in UWP. |
@MattWhilden why does AppX/UWP not support Assembly.Load() at least for non store releases/sideloading? This raises NotSupportedException. |
Hey @MattWhilden... Too obvious? 😁 Thank you for stopping by. We appreciate any and all assistance and guidance you can lend, of course. It is much appreciated!
@gr001 That really means a lot, thank you. I did not know of UWP's difficulties with default .NET functionality but I am not surprised. I am actually amazed anything works at all on that platform. :) Especially ExtendedXmlSerializer since if UWP didn't support
I literally LOL'd on your question @MagicAndre1981... I think @MattWhilden's offer was for ExtendedXmlSerializer-specific problems encountered with UWP. As there are so many gripes, complaints, and identified issues with UWP, giving yourself up for general UWP questions and problems would be a full-time job. 😆 Anyways, all stated, do let us know if there are any further UWP-related ExtendedXmlSerializer issues. Especially now that it seems to do better than the classic XmlSerializer I personally (or rather, my pride) would like to keep it that way. 😇 |
yes, I know it was offtopic, but this is first time a .NET people was here. |
@MagicAndre1981 Actually had to go digging for the answer to this one. I'm glad I did because the checks were originally introduced in 2011 during the development work for what would become .NET Framework 4.5 for Windows 8 (.NET Core shares a lot with this codebase). The goal was to help better support Windows Store apps (nee Metro at the time) and in particular, deliver on various guarantees around security (you may recall Windows AppContainer being a new hotness feature back then). The CoreCLR we ship for UWP Debug has this check to this day. Here's the branch we ship it out of if you want to take a look. My guess is that this was added due to an overabundance of caution but without more analysis it would be hard to tell. In fact, the latest sources for CoreCLR no longer contain any of these checks. I would guess that whatever solution we provide for .NET Core 5 shipping into the Microsoft Store will ship from these more modern sources and not have the check. Hope that helps. |
Thank you for taking the time to investigate, @MattWhilden. I, like @MagicAndre1981, am honored, a bit surprised, and maybe even a little excited to see someone from the .NET team stop by. 👍 I recently saw the announcement for WinUI 3.0 Alpha. Sounds like they have some serious energy and will behind the initiative, which is super encouraging -- inspiring, even. Pairing that with the vision of .NET 5 makes me hopeful for the future and that a lot of the historical friction and frustration experienced with UWP will become a thing of the past. 🚀 |
My pleasure. Always fun to go crawling through older repositories. Certainly let me know if there's other UWP oddities. I don't always have time to dig in but I often cannot help myself. |
ok, thanks, I see this PR deleted the checks. Hopefully we can get the changed code in UWP at some time. |
ok, looks like Microsoft kills now all platform specifics and use same implementation for all platforms:
This may also help you @Mike-EEE in future to simplify code even more when .NET 5 is out. |
Hello,
I would like to use the serializer in a UWP application but when I compile with .Net Native turned on I get "System.PlatformNotSupportedException: 'Dynamic code generation is not supported on this platform.'". Do you think it could be fixed or it means major changes in the serializer. I also attached a sample project. Just hit the 'Test' button.
TestSerializer.zip
This is the callstack that I am getting:
at System.Reflection.Emit.ReflectionEmitThrower.ThrowPlatformNotSupportedException() in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Reflection\Emit\ReflectionEmitThrower.cs:line 11
at System.Reflection.Emit.DynamicMethod..ctor(String name, Type returnType, Type[] parameterTypes, Module m, Boolean skipVisibility) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\Reflection\Emit\DynamicMethod.cs:line 38
at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.DynamicMethodSkeleton.CreateDynamicMethod(Type returnType, Type[] parameterTypes) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 4031
at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.DynamicMethodSkeleton..ctor(Type returnType, Type[] parameterTypes) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 4007
at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.<>c.<.ctor>b__22_1(Type returnType, Type[] parameterTypes) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 1903
at System.Func
3.Invoke(T1 arg1, T2 arg2) at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.CreateDynamicMethodDelegate(Action
1 serviceEmitter) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 3017at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.CreateDelegate(Type serviceType, String serviceName, Boolean throwError) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 3905
at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.CreateDefaultDelegate(Type serviceType, Boolean throwError) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 3868
at ExtendedXmlSerializer.Core.LightInject.ServiceContainer.GetInstance(Type serviceType) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\LightInject\LightInject.cs:line 2732
at ExtendedXmlSerializer.ExtensionModel.Services.GetService(Type serviceType) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\ExtensionModel\Services.cs:line 184
at ExtendedXmlSerializer.Core.Extensions.Get[T](IServiceProvider this) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Core\Extensions.cs:line 217
at ExtendedXmlSerializer.Configuration.RootContext.Create() in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Configuration\RootContext.cs:line 60
at ExtendedXmlSerializer.Configuration.Extensions.Create(IContext this) in C:\projects\extendedxmlserializer\src\ExtendedXmlSerializer\Configuration\Extensions.cs:line 41
at TestSerializer.MainPage.Button_Click(Object sender, RoutedEventArgs e) in C:\Projects\tests\TestSerializer\TestSerializer\MainPage.xaml.cs:line 36
The text was updated successfully, but these errors were encountered: