microsoftgraph / msgraph-sdk-dotnet

Microsoft Graph Client Library for .NET!
https://graph.microsoft.com
Other
690 stars 246 forks source link

[Client bug]: Only HTTP/1.0 and HTTP/1.1 version requests are currently supported #1275

Closed herdma closed 2 years ago

herdma commented 2 years ago

Describe the bug I am trying to create an app registration via the SDK but when running

await graphClient.Applications.Request().AddAsync(application);

I get the following Exception:

ArgumentException: Only HTTP/1.0 and HTTP/1.1 version requests are currently supported.

To Reproduce

  1. Created app registration with "Mobile and desktop applications" authentication
  2. Create new app registration via SDK using InteractiveBrowserCredential authentication

Expected behavior An app registration is created

Client version

Desktop (please complete the following information):

Additional context

// ...
var interactiveBrowserCredential = new InteractiveBrowserCredential(interactiveBrowserCredentialOptions);
var graphClient = new GraphServiceClient(interactiveBrowserCredential, scopes);
await graphClient.Applications.Request().AddAsync(application);
andrueastman commented 2 years ago

Hey @herdma,

Thanks for raising this.

Any chance you can provide more information about your runtime? You provided .NET 4.6.1 but version Microsoft.Graph 4.20.0 targets a minimum version of 4.6.2 on .Net Framework

herdma commented 2 years ago

Hey @andrueastman

Thanks, I created a new project with target framework .NET 4.6.2 and it works now. I chose 4.6.1 previously because the README mentions this:

The Microsoft Graph .NET Client Library targets .NetStandard 2.0 and .Net Framework 4.6.1.

andrueastman commented 2 years ago

Thanks for pointing that out. That is an error in the Readme.

Created #1276 to resolve this.