How to fix NetworkScanner exception: System.TypeInitializationException?

Hello all,

I have been following the ABB tutorial PC SDK getting-started (http://developercenter.robotstudio.com/pcsdk/gettingstarted) on scanning controllers available on the network. However, NetworkScanner class keeps throwing the following exception:

My PC SDK version is 6.04. I am using Visual Studio 2015 Community Edition; .Net framework: 4.6

I can’t find any reference on how to fix this issue. Help please.. Thank you.

If you check the innerexception then you will read that you are missing the reference/assembly “RobotStudio.Services.RobApi”. After adding this reference “RobotStudio.Services.RobApi.dll” it will work.

Always look at the inner exception

In my case was due to the fact that was not the first child of

Regards

Federico