Use Azure active directory to login into an existing asp.net(4.8 framework) mvc application.

singh16 1 Reputation point
2022-11-01T10:33:10.11+00:00

I am trying to integrate AAD in an existing ASP .Net MVC application which is running on 4.8 .net framework but i encounter the below error

"Attempting to gather dependency information for package 'Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.9' with respect to project 'Web\Dme.Web.UI', targeting '.NETFramework,Version=v4.8'
Gathering dependency information took 36.03 sec
Attempting to resolve dependencies for package 'Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.9' with DependencyBehavior 'Lowest'
One or more unresolved package dependency constraints detected in the existing packages.config file. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'Microsoft.AspNet.Authentication 1.0.0-rc1-final constraint: Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Authentication 1.0.0-rc1-final constraint: Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Authentication 1.0.0-rc1-final constraint: Microsoft.Extensions.WebEncoders (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Authentication.Cookies 1.0.0-rc1-final constraint: Microsoft.Extensions.WebEncoders (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.DataProtection 1.0.0-rc1-final constraint: Microsoft.Extensions.DependencyInjection.Abstractions (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.DataProtection 1.0.0-rc1-final constraint: Microsoft.Extensions.Logging.Abstractions (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.DataProtection 1.0.0-rc1-final constraint: Microsoft.Extensions.OptionsModel (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.DataProtection.Abstractions 1.0.0-rc1-final constraint: Microsoft.Extensions.PlatformAbstractions (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.FileProviders.Abstractions 1.0.0-rc1-final constraint: Microsoft.Extensions.Primitives (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Http.Abstractions 1.0.0-rc1-final constraint: Microsoft.Extensions.WebEncoders.Core (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Http.Extensions 1.0.0-rc1-final constraint: Microsoft.Extensions.WebEncoders.Core (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.Http.Features 1.0.0-rc1-final constraint: Microsoft.Extensions.Primitives (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.WebUtilities 1.0.0-rc1-final constraint: Microsoft.Extensions.Primitives (>= 1.0.0-rc1-final)', 'Microsoft.AspNet.WebUtilities 1.0.0-rc1-final constraint: Microsoft.Extensions.WebEncoders.Core (>= 1.0.0-rc1-final)'
Unable to resolve dependency 'Microsoft.Extensions.OptionsModel'. Source(s) used: 'nuget.org'"

And also i am unable to install the package "Microsoft.IdentityModel.Clients.ActiveDirectory"

Let me know if anyone knows the solution to the above problem, attaching screenshot of the same
256072-image.png

255989-image.png

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,396 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,563 questions
{count} votes

1 answer

Sort by: Most helpful
  1. 2022-11-02T23:12:45.347+00:00

    Hello @singh16 and thanks for reaching out. The One or more unresolved package dependency constraints detected in the existing packages.config file error is caused by Unable to resolve dependency 'Microsoft.Extensions.OptionsModel'. Try adding the latter to your project and/or replacing/upgrading as many non-production/release candidates' packages as possible. E.g., Microsoft.AspNet.Authentication 1.0.0-rc1-final

    Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.

    0 comments No comments