Skip to content

RestSharp 106.6.10 problem with .Net Core #1359

@TimOfTcc

Description

@TimOfTcc

Dear All.

I am using RestSharp version 106.6.10 with .NET Core WebApi within Visual Studio successfully. However, after deploying to IIS receiving error:

System.IO.FileNotFoundException: Could not load file or assembly 'RestSharp, Version=106.6.10.0, Culture=neutral, PublicKeyToken=598062e77f915f75'. The system cannot find the file specified.

My code:

            try
            {
                var restclient = new RestSharp.RestClient(Globals.ReportingHostAddr);

                RestRequest request = new RestRequest("ReportManagement/GetStudentIdPhotos", Method.POST);
                request.RequestFormat = DataFormat.Json;
                request.AddJsonBody(args);
                response = restclient.Execute(request);

                if (!response.IsSuccessful)
                {
                    var ex = JsonConvert.DeserializeObject<AppExceptionMessage>(response.Content);

                    return new BadRequestObjectResult(ex);
                };
            }
            catch (Exception ex)
            {
                var parsedEx = CurrentExceptionMgr.ParseErrorMsg(ex.Message);
                return new BadRequestObjectResult(parsedEx);
            };

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions