Skip to main content
The First Step
Jun 6, 2019 7:14 PM UTC
Question

Could not load type 'RingCentral.SendFaxMessageRequest' from assembly 'RingCentral.Net

I have an existing, Windows console application, with Quartz.Net that operates as a scheduler. It targets .NET 4.6.2. It references a class library that targets .NET 4.6.2. I added the RingCentral NuGet package to the class library, with a job to send faxes. When I deployed it to the server, I got

Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I added a binding redirect that pointed to the same version and it fixed that problem. RingCentral.Net.dll is deployed to the application directory. Then, I get

Could not load type 'RingCentral.SendFaxMessageRequest' from assembly 'RingCentral.Net, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

If I add the RingCentral NuGet package to my console application, once again, I get

Could not load file or assembly 'System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    7 replies

    Employee
    Jun 6, 2019 7:28 PM UTC

    You mentioned that you got error after you deployed it to the server. Does it work on your local computer?

    The First Step
    Jun 6, 2019 11:15 PM UTC

    My tests cases of the Job, running inside of VS 2019 work fine. When Quartz.Net executes the job on the server, while referencing RingCentral, I get the errors. I don't know if RingCentral is causing a binding redirect, but both issues only seem to arise, when one or both project reference RingCentral.

    The First Step
    Jun 7, 2019 2:28 AM UTC

    Clarification.

    It is a Windows console app that uses TopShelf to run as a Windows service. It uses Quartz.Net to run scheduled jobs. I only get the above errors, when the desired job executes.

    Employee
    Jun 10, 2019 6:50 AM UTC

    Does this video help? https://www.youtube.com/watch?v=SRQzxqw1bm0

    I have no experience with Quartz.Net. Have you contacted its support?

    The First Step
    Jun 10, 2019 3:28 PM UTC

    @Tyler Liu The video just shows adding the Nuget package. I don't have a problem there. I don't know that TopShelf or Quartz.NET have anything to do with it. I'm not sure if they may cause an issue for RingCentral. I can deploy the scheduling app, without RingCentral, and have no problem. It is only when I add the RingCentral package that I get what appears to be issues with binding redirects. It is just very odd that the scheduling program runs OK. The RingCentral test case runs OK. It is only when I add RingCentral to the scheduling program that there is an issue.

    Employee
    Jun 10, 2019 5:16 PM UTC

    Idea: since both RingCentral and Quartz support .Net Core. Can you make the scheduling program target .Net Core instead of .NET framework 4.6.2 ?

    The First Step
    Jun 10, 2019 6:34 PM UTC

    @Tyler Liu because it is a Windows service, it would have to be .NET Core 3, which supports desktop applications. At one point, I tried to convert it to .NET Core 3 and deployed the runtime (which is still in Beta) to the server. However, I have not been able to get it to run on the server. Thus, I went back to .NET Framework.