about a exception "System.TypeInitializationException" when using PC SDK

I have referenced this two .dll files (ABB.Robotics.dll and ABB.Robotics.Controllers.dll). I created a button and added a click event. In the click event function, I write one line code " NetworkScanner ns = new NetworkScanner();" Also I have added the using instruction

using ABB.Robotics;
using ABB.Robotics.Controllers;
using ABB.Robotics.Controllers.Discovery;
using ABB.Robotics.Controllers.RapidDomain;

But when I run this instruction, the exception has came out

An unhandled exception of type ‘System.TypeInitializationException’ occurred in ABB.Robotics.Controllers.dll

Additional information: The type initializer for ‘ABB.Robotics.Controllers.Internal.NetworkScanner’ threw an exception.

Thank you very much.

Hi Tyler,

Searching this forum with that error gives this topic, where you will find a solution to your issue:

http://forums.robotstudio.com/discussion/7127/pc-sdk-compability-issues

You are using an older version of PC SDK which wasn’t compatible with 64-OS. Which meant you had to edit the app config file.

My recommendation would be to download and use the latest version of PCSDK instead, that way you can avoid this whole issue.

http://developercenter.robotstudio.com/downloads

You would only need to replace the references and the using part since the new version is one dll only that is it. (Click the related “Release Notes” link for the download for more info).

=John

Hello,Tyler. your problem has been solved? I use the 6.03 version of the dll, also encountered the same problem has not resolved, can share with your experience, thank you very much.