Migration SF on .Net Core (Type 'System.Net.IPAddress' cannot be serialized. )


  • Hei!

    I have some service method with IPAddress param.

    Public async Task Do(IPAddress ip)

    All works.

    After migration client  app from Framеwork to Core, i get error on method executing.

    >>System.Runtime.Serialization.InvalidDataContractException : Type 'System.Net.IPAddress' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.

    normal error :-)

    1. Why it works with Framеwork?

    2. How it may work in .Net Core?

    Thank you!

    • Edited by SebasWW Saturday, January 12, 2019 8:03 PM
    Saturday, January 12, 2019 7:53 PM

All replies

  • Can you provide some additional background information on this issue? When migrating to different frameworks not all things will migrate perfectly. So hard to say exactly what the issue is. 
    Monday, January 14, 2019 9:40 PM