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。 提前致谢