Hello,
I am trying to do that Vault Extension method with the following parameters:
[VaultExtensionMethod("GetAccessToken")] public async Task<string> GetAccessTokenAsync(EventHandlerEnvironment env) { CSC_API_Client clt = new CSC_API_Client(); string access_token = await clt.OAuth2_Token("authorization_code", env.Input); return access_token; }
I need to create an async task to wait for the response from an external API client.
When I try to install the VAF, I have this error in event log:
System.ArgumentException: Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method, Boolean throwOnBindFailure) at System.Delegate.CreateDelegate(Type type, Object firstArgument, MethodInfo method) at MFiles.VAF.VaultExtensionMethodInfo..ctor(MethodInfo methodInfo, Object instance, MFVaultAccess requiredVaultAccess, Boolean hasSeparateEventHandlerProxy, EventHandlerVaultUserIdentity vaultUserIdentity) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\MethodInfo.cs:line 252 at MFiles.VAF.VaultApplicationBase.CreateVaultExtensionMethodInfo(MethodInfo methodInfo, Object instance, VaultExtensionMethodAttribute attribute) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 2931 at MFiles.VAF.VaultApplicationBase.RegisterVaultExtensionMethodHandler(MethodInfo method, Object instance, Vault vault) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 2601 at MFiles.VAF.VaultApplicationBase.RegisterHandlers[T](IMethodSource source, Action`3 registerAction, Vault vault) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 2699 at MFiles.VAF.VaultApplicationBase.RegisterMethodsFromSource(IMethodSource source, Vault vault) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 2539 at MFiles.VAF.VaultApplicationBase.LoadHandlerMethods(Vault vault) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 2473 at MFiles.VAF.VaultApplicationBase.InitializeImpl(Vault vault) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 1600 at MFiles.VAF.VaultApplicationBase.Initialize(Vault vaultSrc) in E:\GRB\FkpraJb5\0\libraries\vaf\src\MFiles.VAF\Core\VaultApplicationBase.cs:line 1186
Any idea on how to overcome this? In a console application it works as expected.