簡體   English   中英

升級到 .NetCore3.1 時出現 GetFallbackPolicyAsync 錯誤

[英]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. 但是,在將 API 升級到 .net 內核 V3.1 時,出現以下錯誤:

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

基於以下鏈接( https://docs.microsoft.com/en-us/dotnet/core/compatibility/2.2-3.0 ),我添加了GetFallbackPolicyAsync ,如下所示:

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

但是會發生同樣的錯誤。 知道可能是什么原因嗎?

提前致謝,

發現了問題。 我在包含舊版本Microsoft.AspNetCore.Authorization的項目中引用了 DLL 。 我必須從包含GetFallbackPolicyAsync方法實現的 nugget 安裝最新版本的 Authorization dll。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM