(FileLoadException) File Load Exception While calling K2 Methods

While using a class library method which has references to K2 Assemblies we might see a FileLoadException while debugging in Visual Studio as shown in below Screen shot.

fileloadexception

Just use this attribute useLegacyV2RuntimeActivationPolicy=”true” in the app.config <startup> element of the calling application and then rebuild which should fix the issue.

Sample app.config below

<?xml version=”1.0″ encoding=”utf-8″ ?>

<configuration>

<startup useLegacyV2RuntimeActivationPolicy=”true”>

<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.5.2″ />

</startup>

</configuration>

Advertisements