When attempting to build/compile the A2A Example for C#_64 in Visual Studio 2017 with .Net version 4.0, Visual Studio throws the following error:
System.BadImageFormatException: 'Could not load file or assembly 'Interop.Cspmclientc64, Version=22.214.171.124, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.'
The error that is due to the fact that we cannot find the file:
Inside the sample same code, we state that you must:
// To use the CSPM DLL, first add a reference to the DLL.
// To do this, select Project, Add Reference
// Select the COM tab
// Select Browse
// Select the Cspmclientc64.
// Click Open
// Click OK
Additionally for Visual Studio 2017 with .NET version 4, the code must be updated to:
Cspmclientc64.ccspmclientc64 c = new Cspmclientc64.ccspmclientc64();
Cspmclientc64.ccspmclientc64class c = new Cspmclientc64.ccspmclientc64class();