我正在尝试在 VS 2019 中为我的 Roslyn 分析器创建一个 Visual Studio 扩展。当我将该选项设置Generate .pkgdef File为 true 时,我收到以下异常:
CreatePkgDef : error : ArgumentException: No Visual Studio registration attribute found in this assembly.
The assembly should contain an instance of the attribute 'Microsoft.VisualStudio.Shell.RegistrationAttribute' defined in assembly 'Microsoft.VisualStudio.Shell.Framework' version '16.0.0.0'
at Microsoft.VisualStudio.Tools.CreatePkgDef.ProcessAssembly(String fileName, Hive hive, PkgDefContext context, Boolean register, RegistrationMode mode)
at Microsoft.VisualStudio.Tools.CreatePkgDef.DoCreatePkgDef(InputArguments inputArguments)
at Microsoft.VisualStudio.Tools.CreatePkgDef.Main(String[] arguments)
Run Code Online (Sandbox Code Playgroud) 我正在使用AspNet Boilerplate框架。我正在尝试通过AzureAD在我的应用程序中实现身份验证。我正在使用ASP.NET core 3.0并通过 swagger 测试我的应用程序。我看到令牌未包含在标头中。
Startup.cs 的 ConfigureServices() 方法
{
Type = SecuritySchemeType.OAuth2,
Flows = new OpenApiOAuthFlows()
{
Implicit = new OpenApiOAuthFlow()
{
TokenUrl = new Uri(My Token Url),
AuthorizationUrl = new Uri(My Authorization Url),
Scopes = { { "api://357...../user_impersonation", "Access adt-service" } }
}
}
});
Run Code Online (Sandbox Code Playgroud)
Startup.cs 的 Configure() 方法:
{
options.OAuthClientId("22............");
options.OAuthScopeSeparator(" ");
});
Run Code Online (Sandbox Code Playgroud)
如果我遗漏了什么,请告诉我。