XiaoFaye / WooCommerce.NET

A .NET Wrapper for WooCommerce/WordPress REST API
MIT License
391 stars 217 forks source link

There was an error deserializing the object of type. Encountered unexpected character 'â' #761

Open RBSystemService opened 11 months ago

RBSystemService commented 11 months ago

Wordpress version: 6.1.3 WooCommerce version: 7.1.0 WooCommerce.NET version: 0.8.6.0

Hi, I've a problem with one site when i sync the products, i try to explain.

The creation done well, if i alter one product and do sync works well too. If i do the same sync for the same product one or two days later i receive this error:

Errore durante la deserializzazione dell'oggetto di tipo System.Collections.Generic.List`1[[WooCommerceNET.WooCommerce.v3.Product, WooCommerce.NET, Version=0.8.6.0, Culture=neutral, PublicKeyToken=null]]. Rilevato carattere imprevisto 'â'.

i don't know why, only on one site i've this issue, but isn't a site done by me, so i can't do test for find bad plugins who can alter products informations.

The code is:

        Dim p = Await wc.Product.GetAll(New Dictionary(Of String, String)() From {
        {"sku", strDatiArticoloLocale.Barcode}
        })

        If p.Count > 0 Then

The command wc.Product.GetAll give the error

Do you have some idea for solve this issue?

Thanks

XiaoFaye commented 7 months ago

Use jsonDeserializeFilter to find out what's wrong with the json string.