C# A2A example not working in Visual Studio 2017
search cancel

C# A2A example not working in Visual Studio 2017


Article ID: 103159


Updated On:


CA Privileged Access Manager - Cloakware Password Authority (PA) CA Privileged Access Manager (PAM)


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=, 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.'


PAM 3.x
A2A 3.x


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(); 
instead of:
Cspmclientc64.ccspmclientc64class c = new Cspmclientc64.ccspmclientc64class(); 

Additional Information