C# 无法上载应用程序显示文件

C# 无法上载应用程序显示文件,c#,azure,single-sign-on,azure-active-directory,C#,Azure,Single Sign On,Azure Active Directory,我正在尝试创建一个通过azure ad验证的应用程序。我使用visual studio创建了一个web api,并使用azure portal创建了一个本机客户端应用程序。然后,当我试图在“其他应用程序权限”下添加webapi时,我找不到webapi,但它确实存在。我已经更改了显示文件并添加了以下条目 我指的是这个 由于如下所示的错误,我无法上载显示文件 ParameterValidationException=提供的参数无效; BadRequestException=属性值不能删除,除非 先残

我正在尝试创建一个通过azure ad验证的应用程序。我使用visual studio创建了一个web api,并使用azure portal创建了一个本机客户端应用程序。然后,当我试图在“其他应用程序权限”下添加webapi时,我找不到webapi,但它确实存在。我已经更改了显示文件并添加了以下条目

我指的是这个

由于如下所示的错误,我无法上载显示文件

ParameterValidationException=提供的参数无效; BadRequestException=属性值不能删除,除非 先残疾


问题出在上面,我添加了一个新的GUID,这是不允许的,所以我把它改了回去,在web api的配置部分添加了密钥之后,它工作了

  "oauth2Permissions": [
    {
      "adminConsentDescription": "Allow the application full access to your API on behalf of the signed-in user",
      "adminConsentDisplayName": "Have full access",
      "id": "A1AED6C3-1897-4919-B06E-CDB5B6AF1BD5",
      "isEnabled": true,
      "origin": "Application",
      "type": "User",
      "userConsentDescription": "Allow the application full access to the service on your behalf",
      "userConsentDisplayName": "Have full access to the service",
      "value": "user_impersonation"
    }
  ]