question

David Pedrelli avatar image
David Pedrelli asked David Pedrelli answered

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)
errors
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered

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

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

David Pedrelli avatar image
David Pedrelli answered

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.

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

David Pedrelli avatar image
David Pedrelli answered

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.

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered

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

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

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

David Pedrelli avatar image
David Pedrelli answered Tyler Liu commented

@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.

1 comment
1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

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.

This is indeed very odd. RingCentral.Net SDK does no magic, as far as I can tell. I have no idea at the moment. But let me do more investigation.

0 Likes 0 ·
Tyler Liu avatar image
Tyler Liu answered

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 ?

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

David Pedrelli avatar image
David Pedrelli answered

@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.

1 |1500 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys