简体   繁体   中英

GetFallbackPolicyAsync error when upgrading to .NetCore3.1

I have an API originally having .net core V2.2 and referencing a .net Standard Dll where I'm having a specific implementation of IAuthorizationPolicyProvider interface. However, when upgrading the API to .net core V3.1, I had the following error:

'Method 'GetFallbackPolicyAsync' in type 'xxx' from assembly 'xxx' does not have an implementation.'

Based on the following link ( https://docs.microsoft.com/en-us/dotnet/core/compatibility/2.2-3.0 ), I've added the GetFallbackPolicyAsync like the below:

public Task<AuthorizationPolicy> GetFallbackPolicyAsync() => Task.FromResult<AuthorizationPolicy>(null); 

But the same error occurs. Any idea what could be the cause?

Thanks in advance,

Found the problem. I have a DLL referenced in the project containing an older version of Microsoft.AspNetCore.Authorization . I had to install latest version Authorization dll from nugget containing an implementation of the GetFallbackPolicyAsync method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM