Search code examples
c#apigraphserverblazor

Blazor Server Graph API .NET 6


I'm trying to implement graph API for a blazor server app with .NET 6; but I can't find any documentation- the only blazor server ones i can find are .NET5 or lower using the startup/program.cs

And the only .NET 6 I see is for Blazor WASM.

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/graph-api?view=aspnetcore-6.0

https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-blazor-server

in the latter link, the code provided does not work because it returns the error '. There is no registered service of type 'Microsoft.Identity.Web.ITokenAcquisition' and the solutions involve startup.cs

Can anyone provide any documentation or a point in the right direction?


Solution

  • I used the trick of letting VS add the boiler plate code which solved the issue. More info can be found here Not able to add AddMicrosoftGraph in startup configure services .Net 5.0