Azure KeyVault:尝试创建keyvaultclient时获取System.TypeLoadException

时间:2018-03-16 13:21:59

标签: c# asp.net .net azure azure-keyvault

System.TypeLoadException: 'Inheritance security rules violated by type: 'System.Net.Http.WebRequestHandler'. Derived types must either match the security accessibility of the base type or be less accessible.'

以下代码在控制台应用程序中完全运行,但是当我尝试将其包装在类库中并从webjob调用它时会引发上述错误

public static KeyVaultClient KeyVaultClientProvider()
    {
        if(AssertionCert!=null){GetCert();}

        return new KeyVaultClient(new KeyVaultClient.AuthenticationCallback(GetAccessToken));
    }

我正在使用.Net framework 4.7.1和最新版本的ADAL和AKV nugets。 提前致谢

0 个答案:

没有答案