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

Application using Microsoft.Graph.dll works on Windows 10 but doesn't work on Server 2019 #2567

Open
LauranceOrLaurent opened this issue Jul 2, 2024 · 6 comments

Comments

@LauranceOrLaurent
Copy link

LauranceOrLaurent commented Jul 2, 2024

  • The "program" is a Windows-Service developed with .net/C# (Framework 4.8) VS2022.
  • But this is no factor on the issue. The "bug" can be reproduced with a simple console application.
  • The "program" uses MS.Graph.dll to communicate with Microsoft365 (e.g. @int.sg.ch or @2vgwn2.onmicrosoft.com for development)
  • The program performs requests on users inboxes and calendars
  • It's authenticated via a registered app in the cloud and this app has all needed rights
  • No exceptions/events are present in the EventLogs on the Server

So:

  • The program works well on Windows 10 (in all aspects!)

  • The program is not working from Windows Server 2019
    o More detailed: The request via the MS.Graph.dll results in an unspecified http-request exception (after about 1 minute).
    o I have build in the same request as raw http-request and that works perfect (on Windows 10 and Server 2019)

  • We have already excluded following issues on the Server:
    o Internet/Porxy access (I can do requests from e.g. POSTMAN to the Graph-Rest-Service, that works as expected)
    o .net Framework 4.8 and dotnet 8 is installed and works
    o Authentication works, access token is valid and works an both Platforms (Windows 10 and Server 2019)

The remaining component therefore seems to be between Server 2019 and the dotnet MS.Graph.dll library(s). Something on the Server prevents the work of MS.Graph.dll's

@LauranceOrLaurent LauranceOrLaurent added the status:waiting-for-triage An issue that is yet to be reviewed or assigned label Jul 2, 2024
@LauranceOrLaurent LauranceOrLaurent changed the title Applucation using Microsoft.Graph.dll works on Windows 10 but doesn't work on Server 2019 Application using Microsoft.Graph.dll works on Windows 10 but doesn't work on Server 2019 Jul 2, 2024
@andrueastman
Copy link
Member

Thanks for raising this @LauranceOrLaurent

Are you able to share the following to help us understand the issue better?

  • logs of the errors reported of the client
  • version of the Graph SDK being used(does this error happen with the latest version)
  • sample code of how you are intializing the GraphClient

@andrueastman andrueastman added Status: Needs investigation status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Jul 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jul 2, 2024
@LauranceOrLaurent
Copy link
Author

LauranceOrLaurent commented Jul 3, 2024

logs of the errors reported of the client
- no error logs occure. The response is NULL after one minute (only on a Server 2019) . No exception occures.

The call is like this:
deltaEvents = await GraphServiceClient.Users[userMailAddress].Calendar.Events.Delta.GetAsync(delegate (RequestConfiguration<Microsoft.Graph.Users.Item.Calendar.Events.Delta.DeltaRequestBuilder.DeltaRequestBuilderGetQueryParameters> requestConfiguration)
{
requestConfiguration.QueryParameters.StartDateTime = DateTime.Now.AddYears(30).ToString("s");
});_

_deltaEvents = null on Server 2019, _deltaEvents is ok filled in Windows 10

version of the Graph SDK being used(does this error happen with the latest version)
- with all versions, tried several (it's not a dll or usage problem)
- as i wrote, it works fine on Windows 10

sample code of how you are intializing the GraphClient
- as i wrote, it works all fine on Windows 10, not an initializing problem nor an authentication problem (that part works also on the server 2019).

Tested on two different server 2019. So the problem ist not related to a specific server installation.

@LauranceOrLaurent
Copy link
Author

Any Idea?

@andrueastman
Copy link
Member

andrueastman commented Jul 9, 2024

I'm not sure what could be wrong here.
Any chance you can try adding a responseHandler option to the request as shown in the example here to get the raw native response object?

https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md#native-response-object

I would then try to log the properties(headers, status code and content values) of the response object to see if indeed the API is returning a meaningful response here to isolate where the problem could be.

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Jul 9, 2024
@LauranceOrLaurent
Copy link
Author

LauranceOrLaurent commented Jul 9, 2024

I did that with: https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/upgrade-to-v5.md#native-response-object

As I described before: The Response is also still NULL after 1 minute. No exceptions. Looks like MSGraph.dll can not work/send on Server 2019.

Did you try this on Server 2019 and it worked?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Jul 9, 2024
@LauranceOrLaurent
Copy link
Author

Is there any project (Windowsservice) running properly on a MS-Server 2019 that uses MS-Graph.dll's?

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

No branches or pull requests

2 participants