CFD application fails to compile

ghalse1

Customer
Joined
May 27, 2020
Messages
2
Reaction score
0
I have a call flow application that we've not used for some time, and that I need to bring back to life. It was originally created in CFD 18 on 3CX 18, and worked fine then.

When I uploaded the application to 3CX (20.0U8), I got a compile error. I originally assumed this was because my version of CFD was out of date (it was), so I updated it to CFD 20.2.84.0.

I then completely deleted both the build output and the Call Processing Script entry in 3CX, and did a clean build. The build completed without any errors or warnings in CFD 20.

However, when I upload the new build output to 3CX I get the same compile error. The console output shows:

Code:
:[59811..59827)E: (871,29)-(871,45): Error CS0266: Cannot implicitly convert type 'TCX.Configuration.IPhoneSystem' to 'TCX.Configuration.PhoneSystem'. An explicit conversion exists (are you missing a cast?)

            PhoneSystem ps = PhoneSystem.Root;

                             ^^^^^^^^^^^^^^^^

I'm not sure where to begin looking in my CFD app to debug this.
 
Hello ghalse1,

In your C# code, change the variable type from PhoneSystem to IPhoneSystem.
Line with: PhoneSystem ps = PhoneSystem.Root;
Change to: IPhoneSystem ps = PhoneSystem.Root;

Hope this will help you.

Paulo
 
Moreover, to let the compiler infer the type and avoid issues if this changes again in the future, just use var instead:
var ps = PhoneSystem.Root;
 
Thanks for the responses.

The thing is that I didn't write the code; Call Flow Designer did. So any changes I make to the generated code will be overwritten by subsequent rebuilds in Call Flow Designer.

Ideally, I'm trying to figure out how to get Call Flow Designer to generate code that compiles in 3CX.

I'm not sure whether what I am seeing is a bug in Call Flow Designer or something I need to change in the CFD project after upgrading from 18 to 20.
 

Forum statistics

Threads
111,926
Messages
589,764
Members
164,799
Latest member
RicoDinero