简体   繁体   English

无法从程序集 Microsoft.Azure.Services.AppAuthentication 加载类型 Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider

[英]Could not load type Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider from assembly Microsoft.Azure.Services.AppAuthentication

I am getting below errors when doing the Microsoft quickstart to setup Azure AD login for my Azure SQL:在执行 Microsoft 快速入门为我的 Azure SQL 设置 Azure AD 登录时,我遇到以下错误:

Inner Exception 1: ArgumentException: Failed to instantiate an authentication provider with type 'Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider, Microsoft.Azure.Services.AppAuthentication' for 'ActiveDirectoryInteractive'.内部异常 1:ArgumentException:无法为“ActiveDirectoryInteractive”实例化类型为“Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider、Microsoft.Azure.Services.AppAuthentication”的身份验证提供程序。

Inner Exception 2: TypeLoadException: Could not load type 'Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider' from assembly 'Microsoft.Azure.Services.AppAuthentication'.内部异常 2:TypeLoadException:无法从程序集“Microsoft.Azure.Services.AppAuthentication”加载类型“Microsoft.Azure.Services.AppAuthentication.SqlAppAuthenticationProvider”。

https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-connect-msi

After making changes to my web config files as per the steps, it hit the error when running the web project locally.按照步骤对我的 Web 配置文件进行更改后,在本地运行 Web 项目时遇到了错误。

Looks like the object SqlAppAuthenticationProvider is not implemented in the package Microsoft.Azure.Services.AppAuthentication?看起来像 Microsoft.Azure.Services.AppAuthentication 包中没有实现对象 SqlAppAuthenticationProvider?

'A few moments later...' “几分钟后……”

We had to add an extra conditional symbol in this case 'net472' to make this work.在这种情况下,我们必须添加一个额外的条件符号“net472”才能使其工作。

在此处输入图片说明

There is a note on the Microsoft documentation that is describing the following: Microsoft 文档上有一个注释描述了以下内容:

'For traditional .NET Framework projects, you have to manually configure the conditional compilation symbols for the different target frameworks in Visual Studio via the project's properties pages.' “对于传统的 .NET Framework 项目,您必须通过项目的属性页面为 Visual Studio 中的不同目标框架手动配置条件编译符号。”

Link: https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if链接: https : //docs.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if

I found it very strange because the target framework version is already pointing to 4.7.2 but will not include the symbol net472.我觉得很奇怪,因为目标框架版本已经指向 4.7.2 但不会包含符号 net472。 But never the less, after adding the symbol manually this fixes the issue.但无论如何,手动添加符号后,这可以解决问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法在NuGet包上找到Microsoft.Azure.Services.AppAuthentication - Unable to find Microsoft.Azure.Services.AppAuthentication on NuGet Packages 无法从程序集“Microsoft...AppAuthentication”加载类型“Microsoft...SqlAppAuthenticationProvider” - Could not load type 'Microsoft...SqlAppAuthenticationProvider' from assembly 'Microsoft...AppAuthentication' 运行时错误:无法加载文件或程序集'Microsoft.Owin,版本= 3.0.0.0…Azure移动服务 - Runtime error: Could not load file or assembly 'Microsoft.Owin, Version=3.0.0.0…Azure mobile services 无法从程序集“Microsoft.Azure.WebJobs.Host”加载类型“Microsoft.Azure.WebJobs.Host.Scale.ConcurrencyManager” - Could not load type 'Microsoft.Azure.WebJobs.Host.Scale.ConcurrencyManager' from assembly 'Microsoft.Azure.WebJobs.Host 无法加载文件或程序集“ Microsoft.WindowsAzure.Storage” Azure函数 - Could not load file or assembly 'Microsoft.WindowsAzure.Storage' Azure Functions 无法加载文件或程序集“ Microsoft.Azure.Storage.Emulator.Controller” - Could not load file or assembly 'Microsoft.Azure.Storage.Emulator.Controller' 无法加载文件或程序集'Microsoft.Azure.Graphs' - Could not load file or assembly 'Microsoft.Azure.Graphs' 无法加载文件或程序集'Microsoft.Azure.AppConfiguration.AzconfigClient - Could not Load file or assembly 'Microsoft.Azure.AppConfiguration.AzconfigClient 无法加载文件或程序集“Microsoft.Azure.Management.ServiceBus.Fluent” - Could not load file or assembly 'Microsoft.Azure.Management.ServiceBus.Fluent' 将Autofac与Microsoft Azure移动服务集成 - Integrating Autofac with Microsoft Azure Mobile Services
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM