Dismiss Notice
We would like to remind you that we’re updating our login process for all 3CX forums whereby you will be able to login with the same credentials you use for the Partner or Customer Portal. Click here to read more.

C#: Assembly and Namespace Errors

Discussion in 'Call Flow Designer' started by DolbySR, Jul 28, 2017.

Thread Status:
Not open for further replies.
  1. DolbySR

    Jul 13, 2016
    Likes Received:
    Hey guys!

    I'm working on a super simple C# Add-On to a Call Flow but I am unable to get it compiled within CFD. I always get the following Error:

    Compiling file Main.flow (K:\BWB-Holding AG, Oberdorf - 2069\4 Dokumentation\5 VoIP\3CX VAD Files\BWB-Ferien\Main.flow)...
    Creating source code output...
    Compiling the created source code to .NET library...
    Error compiling source code to .NET library: (4,18): error CS0234: The type or namespace name 'Serialization' does not exist in the namespace 'System.Xml' (are you missing an assembly reference?)
    Error compiling source code to .NET library: (45,17): error CS0012: The type 'XmlReader' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml.ReaderWriter, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
    Error compiling source code to .NET library: (45,34): error CS1503: Argument 1: cannot convert from 'string' to 'System.IO.Stream'
    When I check my code on lines 4 and 45 I cannot find any reference to "Serialization", "System.XML" or anything else. Why is this still the case? Can anybody help me?

  2. edossantos

    edossantos Support Team
    Staff Member 3CX Support

    Jun 27, 2007
    Likes Received:
    Hi @DolbySR,

    First, I would suggest you to take a look at this article:

    As explained in the article, if you need to use external DLLs in your code, you need to copy them to the "CompilerDependencies" folder in the CFD installation folder. When the CFD compiles the C# code, it uses all the DLLs from that folder as references. Please note that you must use .NET Core 1.0 DLLs. If you use .NET Framework DLLs, it will not work. 3CX uses .NET Core and not .NET Framework.

    Also, if the DLLs are not included in the CompilerDependencies folder, pretty sure they will not be available in the server either. So you will also need to copy the DLLs to the 3CX server, to the location specified in the article above.

    Please check that information and let us know if you have any questions.

    Kind regards.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Thread Status:
Not open for further replies.