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

System.MissingMethodException set_SdkVersionHeaderPrefix #253

Open
ForerunnerG34 opened this issue Jun 5, 2020 · 2 comments
Open

System.MissingMethodException set_SdkVersionHeaderPrefix #253

ForerunnerG34 opened this issue Jun 5, 2020 · 2 comments

Comments

@ForerunnerG34
Copy link

I'm using Microsoft.Identity to sign in into MS Graph and obtain an object of IPublicClientApplication. Scopes: "Files.ReadWrite.AppFolder", "Files.Read.All"

Then I'm trying to read any folder from OneDrive, for example the AppFolder:

IntegratedWindowsAuthenticationProvider authenticationProvider = new IntegratedWindowsAuthenticationProvider(PublicClientApp, scopes);
var oneDriveClient = new OneDriveClient(authenticationProvider);
var rootItem = await oneDriveClient.Drive.Special.AppRoot.Request().GetAsync(); // throws exception

And it throws this exception:

System.MissingMethodException
HResult=0x80131513
Message=Method not found: 'Void Microsoft.Graph.BaseRequest.set_SdkVersionHeaderPrefix(System.String)'.
Source=Microsoft.OneDrive.Sdk
StackTrace:
at Microsoft.OneDrive.Sdk.ItemRequest..ctor(String requestUrl, IBaseClient client, IEnumerable1 options) at Microsoft.OneDrive.Sdk.ItemRequestBuilder.Request(IEnumerable1 options)
at Microsoft.OneDrive.Sdk.ItemRequestBuilder.Request()

@YuraGoots
Copy link

I've got the same error when trying to up version of Microsoft.Graph and Microsoft.Graph.Core libraries.
It looks like Microsoft.OneDriveSDK works only with Microsoft.Graph/Microsoft.Graph.Core 1.12.0.

@YuraGoots
Copy link

YuraGoots commented Feb 15, 2021

I've investigated why this happened.
That's because new implementation of Microsoft.Graph.BaseRequest does not contain this property:

    // Summary:
    //     Gets or sets the telemetry header prefix for requests.
    protected string SdkVersionHeaderPrefix
    {
        get;
        set;
    }

And in Microsoft.OneDrive.Sdk.ItemRequest ctor we can see this code:

this.SdkVersionHeaderPrefix = "onedrive";

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

2 participants