question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting System.ArgumentException calling to Serialize

See original GitHub issue

I’m getting this:

sin titulo

You can reproduce it with this zipped solution. Run XamlLoadTest and you will see. OmniXaml.zip

{System.ArgumentException: Incorrect number of arguments supplied for call to method ‘Void Add(System.Object, System.Object)’ Parameter name: method at System.Dynamic.Utils.ExpressionUtils.ValidateArgumentCount(MethodBase method, ExpressionType nodeKind, Int32 count, ParameterInfo[] pis) at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method) at System.Linq.Expressions.Expression.Call(Expression instance, MethodInfo method, IEnumerable1 arguments) at ExtendedXmlSerialization.Cache.ObjectAccessors.CreateMethodAddToDictionary(Type type) at ExtendedXmlSerialization.Cache.TypeDefinition..ctor(Type type) at ExtendedXmlSerialization.Cache.TypeDefinitionCache.<>c.<GetDefinition>b__3_0(Type t) at System.Runtime.CompilerServices.ConditionalWeakTable2.GetValue(TKey key, CreateValueCallback createValueCallback) at ExtendedXmlSerialization.Cache.PropertieDefinition…ctor(Type type, PropertyInfo propertyInfo, String name) at ExtendedXmlSerialization.Cache.TypeDefinition.GetPropertieToSerialze() at System.Lazy1.CreateValue() at System.Lazy1.LazyInitValue() at ExtendedXmlSerialization.ExtendedXmlSerializer.WriteXml(XmlWriter writer, Object o, TypeDefinition type, String name, Boolean writeReservedObject, Boolean forceSaveType) at ExtendedXmlSerialization.ExtendedXmlSerializer.Serialize(Object o) at XamlLoadTest.Program.ShowResult(Object instance) in F:\Source\Repos\OmniGUI\OmniXAML\XamlLoadTest\Program.cs:line 29 at XamlLoadTest.Program.Main(String[] args) in F:\Source\Repos\OmniGUI\OmniXAML\XamlLoadTest\Program.cs:line 23} System.ArgumentException

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
WojciechNagorskicommented, May 11, 2017

You can use: new ConfigurationContainer().UseOptimizedNamespaces().Create(); If you want to optimize namespaces.

2reactions
SuperJMNcommented, May 11, 2017

Wow, it works as expected! It looks like I’m not too used to dealing with buffered things 😃 I get the XML now! Look the output at the bottom of the snapshot.

sin titulo

It seems you’re doing a GREAT job with this ExtendedXmlSerializer!

Big thanks!

BTW, if you want to get in touch, just look for my nickname in Skype. See you, Mike! 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Serialization throwing ArgumentException ...
The Serialize method doesn't announce this ArgumentException or InvalidCastException may occur (in the Exceptions section). I tried ...
Read more >
Problem Serializing System.ArgumentException using V2 ...
My service topology is pretty simple. I have a Asp.Net Core calling stateless Svc via service remoting V2. The caller (in this case...
Read more >
ArgumentException Class (System)
Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. (Inherited from Exception) ...
Read more >
ArgumentException is thrown when calling Unity.Entities ...
Actual result: ArgumentException: Tried to serialized an Entity reference however entity reference serialization has been explicitly disabled.
Read more >
Enable data contract serialization for remoting exceptions
Enable DataContract remoting exception serialization on the Service side by using FabricTransportRemotingListenerSettings.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found