Skip to content

DataContractSerializerTests.DCS_BasicRoundTripResolveDTOTypes Fails on UWP #21649

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

Closed
shmao opened this issue May 11, 2017 · 2 comments
Closed
Labels
area-Serialization tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Milestone

Comments

@shmao
Copy link
Contributor

shmao commented May 11, 2017

The test fails on UWP due to dotnet/corert#2946.

<test name="DataContractSerializerTests.DCS_BasicRoundTripResolveDTOTypes" type="DataContractSerializerTests" method="DCS_BasicRoundTripResolveDTOTypes" time="0.0042005" result="Fail">
        <failure exception-type="System.InvalidOperationException">
          <message><![CDATA[System.InvalidOperationException : Failed to create Delegate for method: get_UtcDateTime. Please keep the metadata for type System.Runtime.Serialization.DateTimeOffsetAdapter by modifying rd.xml.\r\n---- System.ArgumentException : Arg_DlgtTargMeth. For more information, visit http://go.microsoft.com/fwlink/?LinkId=623485]]></message>
          <stack-trace><![CDATA[   at System.Runtime.Serialization.CreateDelegateExtension.CreateDelegate<System.__Canon>$catch$0() in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\AccessorBuilder.cs:line 188
   at System.Runtime.Serialization.FastInvokerBuilder.CreateGetterInternal<System.__UniversalCanon, System.__UniversalCanon>(PropertyInfo propInfo) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\AccessorBuilder.cs:line 115
   at System.Func$2<System.IntPtr,System.__Canon>.InvokeOpenStaticThunk(IntPtr arg) in InvokeOpenStaticThunk:line 16707566
   at System.Runtime.Serialization.FastInvokerBuilder.CreateGetter(MemberInfo memberInfo) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\AccessorBuilder.cs:line 39
   at System.Runtime.Serialization.ReflectionReader.ReflectionGetMemberValue(Object obj, $DataMember dataMember) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 106
   at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $ClassDataContract derivedMostClassContract, Int32 childElementIndex, $XmlDictionaryString[] emptyStringArray) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 171
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $XmlDictionaryString[] memberNames) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 35
   at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 20
   at System.Runtime.Serialization.Json.JsonFormatCollectionWriterDelegate.Invoke($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContextComplexJson context, $CollectionDataContract dataContract) in Invoke:line 16707566
   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ClassDataContract.cs:line 508
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 651
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 279
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType($XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 231
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize($XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 138
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference($XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 106
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionInternalSerialize($XmlWriterDelegator xmlWriter, $XmlObjectSerializerWriteContext context, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Type memberType, Boolean isNullableOfT) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 164
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteValue($XmlWriterDelegator xmlWriter, $XmlObjectSerializerWriteContext context, Type type, Object value, Boolean writeXsiType, $PrimitiveDataContract primitiveContractForParamType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 95
   at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $ClassDataContract derivedMostClassContract, Int32 childElementIndex, $XmlDictionaryString[] emptyStringArray) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 183
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $XmlDictionaryString[] memberNames) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 35
   at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 20
   at System.Runtime.Serialization.Json.JsonFormatCollectionWriterDelegate.Invoke($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContextComplexJson context, $CollectionDataContract dataContract) in Invoke:line 16707566
   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ClassDataContract.cs:line 508
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 651
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeAndVerifyType($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, Boolean verifyKnownType, RuntimeTypeHandle declaredTypeHandle, Type declaredType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 279
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithXsiType($XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle objectTypeHandle, Type objectType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle, Type declaredType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 231
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerialize($XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 138
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.InternalSerializeReference($XmlWriterDelegator xmlWriter, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Int32 declaredTypeID, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 106
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionInternalSerialize($XmlWriterDelegator xmlWriter, $XmlObjectSerializerWriteContext context, Object obj, Boolean isDeclaredType, Boolean writeXsiType, Type memberType, Boolean isNullableOfT) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 164
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteValue($XmlWriterDelegator xmlWriter, $XmlObjectSerializerWriteContext context, Type type, Object value, Boolean writeXsiType, $PrimitiveDataContract primitiveContractForParamType) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 95
   at System.Runtime.Serialization.ReflectionXmlClassWriter.ReflectionWriteMembers($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $ClassDataContract derivedMostClassContract, Int32 childElementIndex, $XmlDictionaryString[] emptyStringArray) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 183
   at System.Runtime.Serialization.ReflectionClassWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract, $XmlDictionaryString[] memberNames) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionClassWriter.cs:line 35
   at System.Runtime.Serialization.ReflectionXmlFormatWriter.ReflectionWriteClass($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context, $ClassDataContract classContract) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ReflectionXmlFormatWriter.cs:line 20
   at System.Runtime.Serialization.Json.JsonFormatCollectionWriterDelegate.Invoke($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContextComplexJson context, $CollectionDataContract dataContract) in Invoke:line 16707566
   at System.Runtime.Serialization.ClassDataContract.WriteXmlValue($XmlWriterDelegator xmlWriter, Object obj, $XmlObjectSerializerWriteContext context) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\ClassDataContract.cs:line 508
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.WriteDataContractValue($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 651
   at System.Runtime.Serialization.XmlObjectSerializerWriteContext.SerializeWithoutXsiType($DataContract dataContract, $XmlWriterDelegator xmlWriter, Object obj, RuntimeTypeHandle declaredTypeHandle) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs:line 155
   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObjectContent($XmlWriterDelegator writer, Object graph, $DataContractResolver dataContractResolver) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\DataContractSerializer.cs:line 364
   at System.Runtime.Serialization.DataContractSerializer.InternalWriteObject($XmlWriterDelegator writer, Object graph, $DataContractResolver dataContractResolver) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\DataContractSerializer.cs:line 247
   at System.Runtime.Serialization.XmlObjectSerializer.WriteObjectHandleExceptions($XmlWriterDelegator writer, Object graph, $DataContractResolver dataContractResolver) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializer.cs:line 71
   at System.Runtime.Serialization.XmlObjectSerializer.WriteObject($XmlDictionaryWriter writer, Object graph) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializer.cs:line 57
   at System.Runtime.Serialization.XmlObjectSerializer.WriteObject(Stream stream, Object graph) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\XmlObjectSerializer.cs:line 27
   at DataContractSerializerTests.SerializeAndDeserialize<System.__Canon>(__Canon value, String baseline, $DataContractSerializerSettings settings, Func$1<$DataContractSerializer> serializerFactory, Boolean skipStringCompare) in d:\OSS\corefx-1\corefx\src\System.Runtime.Serialization.Xml\tests\DataContractSerializer.cs:line 3180
   at DataContractSerializerTests.DCS_BasicRoundTripResolveDTOTypes() in d:\OSS\corefx-1\corefx\src\System.Runtime.Serialization.Xml\tests\DataContractSerializer.cs:line 2613
   at _$ILCT$.$ILT$ReflectionDynamicInvoke$.InvokeRetV(Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean targetIsThisCall)
   at System.InvokeUtils.CalliIntrinsics.Call(IntPtr dynamicInvokeHelperMethod, Object thisPtr, IntPtr methodToCall, ArgSetupState argSetupState, Boolean isTargetThisCall)
   at System.InvokeUtils.CallDynamicInvokeMethod(Object thisPtr, IntPtr methodToCall, Object thisPtrDynamicInvokeMethod, IntPtr dynamicInvokeHelperMethod, IntPtr dynamicInvokeHelperGenericDictionary, Object targetMethodOrDelegate, Object[] parameters, BinderBundle binderBundle, Boolean invokeMethodHelperIsThisCall, Boolean methodToCallIsThisCall) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.CoreLib\src\System\InvokeUtils.cs:line 400
----- Inner Stack Trace -----
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.CreateDelegateWorker(Type delegateType, Object target, Boolean allowClosed) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs:line 99
   at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.CreateDelegate(Type delegateType) in f:\dd\ndp\fxcore\CoreRT\src\System.Private.Reflection.Core\src\System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs:line 71
   at System.Runtime.Serialization.CreateDelegateExtension.CreateDelegate<System.__Canon>(MethodInfo method) in d:\OSS\corefx-1\corefx\src\System.Private.DataContractSerialization\src\System\Runtime\Serialization\AccessorBuilder.cs:line 184]]></stack-trace>
        </failure>
      </test>
@shmao
Copy link
Contributor Author

shmao commented May 11, 2017

DataContractSerializerTests.DCS_SimpleStructWithProperties also failed for the same reason.

shmao referenced this issue in shmao/corefx May 11, 2017
shmao referenced this issue in dotnet/corefx May 15, 2017
* Workaround Issue Related to DateTimeOffsetAdapter.

Ref #19663

* Revert the change on DateTimeOffsetAdapter
@shmao
Copy link
Contributor Author

shmao commented Jun 1, 2017

Closing the issue as it didn't repro anymore.

@shmao shmao closed this as completed Jun 1, 2017
@msftgits msftgits transferred this issue from dotnet/corefx Jan 31, 2020
@msftgits msftgits added this to the UWP6.0 milestone Jan 31, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Serialization tracking-external-issue The issue is caused by external problem (e.g. OS) - nothing we can do to fix it directly
Projects
None yet
Development

No branches or pull requests

2 participants