Search code examples
.netmicrosoft-graph-api

Subscription does not exist in the namespace Microsoft.Graph


I'm following the tutorial here https://learn.microsoft.com/en-us/training/modules/msgraph-changenotifications-trackchanges/5-exercise-change-notifications

But I'm getting this error:

The type or namespace name 'Subscription' does not exist in the namespace 'Microsoft.Graph' (are you missing an assembly reference?)

Anyone can point what I'm doing wrong?

thanks


Solution

  • It can happen in case you are using NuGet Microsoft.Graph v5. There are breaking changes between v4 and v5.

    Check the version of the Microsoft.Graph packages and try to downgrade to the latest version 4.54.0.

    Otherwise you need to rewrite the code for v5 and it can be quite challenge because there will more issues.