• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

WPF + CRM integration

Status
Not open for further replies.

Hogne Vevle

Joined
Jul 28, 2017
Messages
1
Reaction score
0
Hi,

I'm trying to build a CRM integration for the 3CX client.

As some user interaction often is required to determine the correct contact (a phone number can be associated with several contacts), I'm trying to display a form built in WPF. This has proven a bit difficult.

During compilation of the plugin, DotNetScriptPlugin.log complains that none of the form variables (to access the form elements) in my .xaml.cs file are available. It also complains about InitializeComponent() not being found.

Adding the references to PresentationCore, PresentationFramework and WindowsBase was done by including these DLL-s inside the project, and referencing those DLLs explicitly. (Don't know why this had to be done this way, but just adding the references to the project through the "Assemblies" tab in VS resulted in errors such as "Could not find the meta data file PresentationCore.dll - File '' - Line: 0 - Column: 0". By including the DLLs in the project, I was able to work around this.

Building the project locally works fine (both via VS and directly via msbuild via the command line).
I'm suspecting that it doesn't compile the .xaml file as it's supposed to, and goes directly to the .xaml.cs.

Does anyone have any ideas? I would think old school Windows Forms would work, but I'd much rather use WPF.

The build logs as shown in DotNetScriptPlugin.log:

28.07.2017 11.36.59 - Loading Visual Studio C# project from file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MyPlugin.csproj
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\lib\FontAwesome.WPF.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\lib\Newtonsoft.Json.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\lib\PresentationCore.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\lib\PresentationFramework.dll
28.07.2017 11.36.59 - Adding reference: System.dll
28.07.2017 11.36.59 - Adding reference: System.Core.dll
28.07.2017 11.36.59 - Adding reference: System.Web.Extensions.dll
28.07.2017 11.36.59 - Adding reference: System.Xaml.dll
28.07.2017 11.36.59 - Adding reference: System.Xml.Linq.dll
28.07.2017 11.36.59 - Adding reference: System.Data.DataSetExtensions.dll
28.07.2017 11.36.59 - Adding reference: Microsoft.CSharp.dll
28.07.2017 11.36.59 - Adding reference: System.Data.dll
28.07.2017 11.36.59 - Adding reference: System.Drawing.dll
28.07.2017 11.36.59 - Adding reference: System.Xml.dll
28.07.2017 11.36.59 - Adding reference: System.Web.dll
28.07.2017 11.36.59 - Adding reference: System.Windows.Forms.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\CRMPluginUtils.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\MyPhoneCRMIntegration.dll
28.07.2017 11.36.59 - Adding reference: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\lib\WindowsBase.dll
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\BasicConfigurationControl.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\BasicConfigurationControl.Designer.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\ConfigurationParameters.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\ContactFinder.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MainWindow.xaml.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MyPlugin.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MySession.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\Objects.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\Parameters.cs
28.07.2017 11.36.59 - Ignoring compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\Properties\AssemblyInfo.cs
28.07.2017 11.36.59 - Adding compilation file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\Resources.Designer.cs
28.07.2017 11.36.59 - Adding resource file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\BasicConfigurationControl.resx
28.07.2017 11.36.59 - Adding resource file: C:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\Resources.resx
28.07.2017 11.36.59 - Start compiling, converting resources to binary format...
28.07.2017 11.36.59 - Compiling code...
28.07.2017 11.37.00 - Errors found during compilation:
28.07.2017 11.37.00 - 0 - InitializeComponent does not exist in the current context - File 'c:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MainWindow.xaml.cs' - Line: 26 - Column: 13
28.07.2017 11.37.00 - 1 - MyPlugin.MainWindow does not contain a definition for ShowAllMatchingCustomersButton, and no extension method 'ShowAllMatchingCustomersButton' accepting a first argument of MyPlugin.MainWindow (are you missing a using directive or an assembly reference?) - File 'c:\ProgramData\3CXPhone for Windows\PhoneApp\DotNetScripts\MyPlugin\MainWindow.xaml.cs' - Line: 33 - Column: 18

[...] (repeated for every variable)

28.07.2017 11.37.00 - Error processing myphone status change: System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\Hogne\AppData\Local\Temp\jgxcnp5p.dll' or one of its dependencies. Systemet finner ikke angitt fil.
Filnavn: file:///C:\Users\Hogne\AppData\Local\Temp\jgxcnp5p.dll
ved System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
ved System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
ved System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
ved System.Reflection.Assembly.Load(AssemblyName assemblyRef, Evidence assemblySecurity)
ved System.CodeDom.Compiler.CompilerResults.get_CompiledAssembly()
ved DotNetScriptPlugin.DotNetScript.CreatePluginInstance(String typeName, IMyPhoneCallHandler callHandler)
ved DotNetScriptPlugin.DotNetScriptPlugin.callHandler_OnMyPhoneStatusChanged(Object sender, MyPhoneStatus status)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.