aspnet / Configuration

[Archived] Interfaces and providers for accessing configuration files. Project moved to https://github.com/aspnet/Extensions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters

CarlosOnline opened this issue · comments

Could not load type Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters for .net core 2.0.3.

Is there any way to resolve this issue?

Error:
Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.2.6005, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
Source=Microsoft.WindowsAzure.MediaServices.Client.Common.Authentication

Code:

CloudMediaContext AzureContext; // See Azure Media Services for initialize instructions
AzureContext.Assets.ToList(); // Exception here

Exception

System.TypeLoadException
  HResult=0x80131522
  Message=Could not load type 'Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters' from assembly 'Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.2.6005, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
  Source=Microsoft.WindowsAzure.MediaServices.Client.Common.Authentication
  StackTrace:
   at Microsoft.WindowsAzure.MediaServices.Client.AzureAdTokenProvider.GetToken()
   at Microsoft.WindowsAzure.MediaServices.Client.AzureAdTokenProvider.GetAuthorizationHeader()
   at Microsoft.WindowsAzure.MediaServices.Client.OAuth.OAuthDataServiceAdapter.AddAccessTokenToRequest(WebRequest request)
   at Microsoft.WindowsAzure.MediaServices.Client.AzureMediaServicesClassFactory.<>c__DisplayClass22_0.<GetAccountApiEndpoint>b__0()
   at Microsoft.Practices.TransientFaultHandling.RetryPolicy.<>c__DisplayClass1.<ExecuteAction>b__0()
   at Microsoft.WindowsAzure.MediaServices.Client.TransientFaultHandling.MediaRetryPolicy.ExecuteAction[TResult](Func`1 func)
   at Microsoft.Practices.TransientFaultHandling.RetryPolicy.ExecuteAction(Action action)
   at Microsoft.WindowsAzure.MediaServices.Client.AzureMediaServicesClassFactory.GetAccountApiEndpoint(OAuthDataServiceAdapter dataServiceAdapter, ServiceVersionAdapter versionAdapter, Uri apiServer, UserAgentAdapter userAgentAdapter, IWebRequestAdapter clientRequestIdAdapter)
   at Microsoft.WindowsAzure.MediaServices.Client.AzureMediaServicesClassFactory.<>c__DisplayClass25_0.<CreateAzureMediaServicesEndPoint>b__0()
   at Microsoft.WindowsAzure.MediaServices.Client.Cache`1.GetOrAdd(String key, Func`1 valueFactory, Func`1 expirationFactory)
   at Microsoft.WindowsAzure.MediaServices.Client.AzureMediaServicesClassFactory..ctor(Uri azureMediaServicesEndpoint, CloudMediaContext mediaContext)
   at Microsoft.WindowsAzure.MediaServices.Client.CloudMediaContext.get_MediaServicesClassFactory()
   at Microsoft.WindowsAzure.MediaServices.Client.AssetCollection.<.ctor>b__2_0()
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at Microsoft.WindowsAzure.MediaServices.Client.BaseCollection`1.get_Provider()
   at System.Linq.Queryable.Where[TSource](IQueryable`1 source, Expression`1 predicate)
   at SUR.AzureStreaming.Assets.GetAssets(String prefix, Boolean withLocatorsOnly) in E:\sur\Streaming2\Providers\AzureStreaming\AzureAsset.cs:line 64

There is a similar problem in Azure Functions (I don't have the ref to hand). Maybe related?