Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method not found: 'Void Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters..ctor(Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior)'. #202

Open
Eilon opened this issue Apr 5, 2018 · 7 comments

Comments

@Eilon
Copy link
Member

Eilon commented Apr 5, 2018

From @CarlosOnline on April 5, 2018 13:11

Missing method: Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters..ctor is missing for .net core 2.0.3.
Is there any way to resolve this issue?

Error:
Message=Method not found: 'Void Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters..ctor(Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior)'.
Source=Microsoft.WindowsAzure.MediaServices.Client.Common.Authentication

Code:

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

Exception

System.MissingMethodException
  HResult=0x80131513
  Message=Method not found: 'Void Microsoft.IdentityModel.Clients.ActiveDirectory.PlatformParameters..ctor(Microsoft.IdentityModel.Clients.ActiveDirectory.PromptBehavior)'.
  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)

Copied from original issue: aspnet/Configuration#806

@Dinesh2411
Copy link

What was the solution??

@CarlosOnline
Copy link

I bypassed ADAL for the most part.

public static CloudMediaContext AzureContext => new CloudMediaContext(new Uri(RESTAPIEndpoint + "/"), new MediaServicesTokenProvider());


    public class MediaServicesTokenProvider : ITokenProvider
    {
        public string GetAuthorizationHeader()
        {
            return "Bearer " + JwtToken;
        }

        public Tuple<string, DateTimeOffset> GetAccessToken()
        {
            return new Tuple<string, DateTimeOffset>(JwtToken, DateTimeOffset.Now.AddHours(1));
        }
    }

@shudson302
Copy link

Is this fixed? I am still getting this error. I am using the sample code from this documentation:
https://docs.microsoft.com/en-us/azure/storage/common/storage-auth-aad-app

I am trying to use the azure AD authentication to connect to Azure storage

testXF.zip

@CarlosOnline
Copy link

CarlosOnline commented Mar 6, 2019 via email

@yuchaozh
Copy link

Same problem here.

@Juliako
Copy link
Contributor

Juliako commented Apr 15, 2019

Hi,
We would like to let you know that Azure Media Services v2 is our “legacy” API now and we are not actively building new features or functionality on that path. All of our investments are focused on the v3 API which is an ARM based API and a more consistent and performant development model aligned with all other Azure services. We strongly encourage you to migrate to Media Services v3 API to get access to all of our latest features and continued performance updates, especially if you are looking for .Net Core support (or languages other than .Net). We specifically released .NET Core and Standard SDK support on the new v3 API. Please see the migration guidance for moving from Media Services v2 to v3.

Please let us know if there is a reason or missing features for why you would not be able to migrate to v3.

@Juliako
Copy link
Contributor

Juliako commented Apr 15, 2019

#please-close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants