RobotStudio event

Load Mechanism from .rslib file

Hello,

I´m currently working on the integration of the functionality of the ABB.Robotics.PC API into a plugin for our main workflow software.

For the ABB.Robotics.PC API this made no problem so far.

Furthermore, I tried to calculate the inverse kinematic with the Mechanism.CalculateInverseKinematics Method. 
So I wanted to create a Mechanism from a robot .rslib file with the GraphicComponentLibrary.
But this never relay worked ... just occasionally ( I can not think of any causal relation when it worked) I could access the DocumentInfo of the Loaded Robot File.
Most of the time it gives me this Error:
1. Solution exception:The type initializer for 'ABB.Robotics.RobotStudio.Stations.GraphicComponentLibrary' threw an exception.

So my question would be:
Is it actually possible to Load a Mechanism from a .rslib file and calculate the InverseKinematic as a Plugin of a different (c#) Software?

And if Yes, how? what do I miss?

Thank you in advance

Grüße
Benedikt

Here is the part of the very basic code:

using System;
using System.Collections.Generic;
using ABB.Robotics.RobotStudio;
using ABB.Robotics.RobotStudio.Stations;

        protected override void SolveInstance()
        {
            string filePath = "the .rslib";  

            ABB.Robotics.RobotStudio.Stations.Mechanism mecha = (Mechanism) GraphicComponentLibrary.Load(filePath, true).RootComponent.Copy();
        }