Bukimedia / PrestaSharp

CSharp .Net client library for the PrestaShop API via web service
GNU General Public License v3.0
154 stars 152 forks source link

RestSharp error in GetByFilter #464

Closed polaije closed 7 months ago

polaije commented 1 year ago

Please consider making a Pull Request if you are capable of doing so.

If your problem is how to implement anything with PrestaSharp or make a question, please, refer to our Slack# group with this request link: https://join.slack.com/t/prestasharp/shared_invite/enQtNTM2OTI1OTg0NzUyLTY4NDdkZDFmY2EwMGE4MTMzZjk5YzZiMTk3MzUwNzUxNTdhMWEwZjFjNDJiZTIyMjI0MDM0NTcwMzIzNGI0Njc

Library Version:

1.2.9

https://www.nuget.org/packages/PrestaSharp/1.2.9

Prestashop version:

1.7.8.9

Hello, I have installed a new PC with Windows 11 and copy my project from the old Windows 10.

The issue is with reinstallation of Prestasharp and RestSharp (Version 106.5.4) and I run the project I get an error in : Dictionary<string, string> filter = new Dictionary<string, string>(); filter.Add("Active", "1");

        string Verif = string.Empty;
        List<product> SelProducts = ProductFact.GetByFilter(filter, "reference_ASC", "9999");

System.IO.FileLoadException : 'Impossible de charger le fichier ou l'assembly 'RestSharp, Version=106.11.4.0, Culture=neutral, PublicKeyToken=598062e77f915f75' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)'

I have try with another version of RestSharp and I get another error that there is no parameters valid for this function.

Also when I instal Prestasharp from Nuget, Prestasharp is installed with RestSharp and a lot of Microsoft assemblies. This was not the case with my PC with Windows 10.

Can you help me to reinstall completely Prestasharp with RestSharp.

Thanks in advance, Jean-Marie

jesiiu commented 10 months ago

There is no problem with RestSharp, you must install older .net version, it work for me, it should be 4.7.2 or something like that

LameuleFR commented 7 months ago

As said. The problem come from missing dependencies, make sure to install .net framework 4.7.2 if u use 1.x.x versions of PrestaSharp

polaije commented 7 months ago

Hello, I use VS2022 and I cannot choose a framework less than 5.0.