3cx-web-API icon indicating copy to clipboard operation
3cx-web-API copied to clipboard

Compile issue (Debian)

Open castlerockconsult opened this issue 1 year ago • 2 comments

Hi, My environment is as follows:

  • Debian 10
  • 3CX 18.0 (Build 312)
  • .Net 5.0.408

The PBX is a fresh install with all updates and the code is from the MASTER branch. I have updated the location of 3cxpscomcpp2.dll and removed the private/false line in WebAPICore.csproj. Below is the compile error:

voipl@3cx:~/3cx-web-API-Master$ dotnet build WebAPICore.csproj
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  All projects are up-to-date for restore.
/home/voipl/3cx-web-API-Master/update.cs(16,30): error CS0161: 'update.updateid(string, string)': not all code paths return a value [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
/home/voipl/3cx-web-API-Master/getcallid.cs(29,38): warning CS0618: 'ActiveConnection.HistoryIDOfTheCall' is obsolete: 'V14. This ID is not stored in call history database. So this property should not be used to store references' [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]

Build FAILED.

/home/voipl/3cx-web-API-Master/getcallid.cs(29,38): warning CS0618: 'ActiveConnection.HistoryIDOfTheCall' is obsolete: 'V14. This ID is not stored in call history database. So this property should not be used to store references' [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
/home/voipl/3cx-web-API-Master/update.cs(16,30): error CS0161: 'update.updateid(string, string)': not all code paths return a value [/home/voipl/3cx-web-API-Master/WebAPICore.csproj]
    1 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.97

I'm not able to work out why the compile is failing as it looks like a generic issue but I can't see the cause.

Thanks.

castlerockconsult avatar May 17 '23 07:05 castlerockconsult

I have looked further into this and can confirm that this can be resolved by adding a "return null;" at line 35 after the Console.WriteLine command within the catch.

castlerockconsult avatar May 17 '23 08:05 castlerockconsult

Thank you @castlerockconsult !

So basically just add inside the file update.cs after Console.WriteLine($"Update failed\n{ex}"); the line "return null;"

m4aax16 avatar Jun 29 '23 17:06 m4aax16