Giter Site home page Giter Site logo

PlatformNotSupportedException on MacOS via Xamarin / Make CacheChanged event configurable about microsoft-authentication-extensions-for-dotnet HOT 7 CLOSED

azuread avatar azuread commented on July 22, 2024
PlatformNotSupportedException on MacOS via Xamarin / Make CacheChanged event configurable

from microsoft-authentication-extensions-for-dotnet.

Comments (7)

mrward avatar mrward commented on July 22, 2024 1

Not seen this error in VS Mac.

VS Mac uses the FileSystemWatcher class from Mono for other things. I suspect this may be specific to Xamarin.Mac projects. VS Mac is a hybrid - .net framework/Xamarin.Mac project.

from microsoft-authentication-extensions-for-dotnet.

mrward avatar mrward commented on July 22, 2024 1

Yeah looks like it is not implemented for Xamarin.Mac projects unless they target the full framework (which is basically Mono's .NET Framework).

xamarin/xamarin-macios#5197
mono/mono#11832

from microsoft-authentication-extensions-for-dotnet.

tipa avatar tipa commented on July 22, 2024 1

triggering the event should be configurable, i.e. WithCacheChangedEvent() - allowing developers to disable the event themselves.

Personally, I would appreciate such an option. I do not need the "CacheChanged" event, I simply want to use the MSAL library like on Android/iOS/UWP

from microsoft-authentication-extensions-for-dotnet.

tipa avatar tipa commented on July 22, 2024 1

I hate to say it but it crashes again. Here logger is null which causes a NullReferenceException in TarceSourceLogger.LogError. Should have actually tested your changes - sorry 🙈

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

Interesting. A FileSystemWatcher is used to generate a "CacheChanged" event. It looks like Xamarin does not implement this class, as others have also observed here

We tested this on .net core and .net classic, but not on Mono. @crmann1, @mrward, @sgmunn - did you encounter this issue already ?

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

Easy fix would be to just swallow that exception and ignore it. In which case there the event would not fire.

More complex fixes:

  • find an alternative implementation for FileSystemWatcher on Mono
  • triggering the event should be configurable, i.e. WithCacheChangedEvent() - allowing developers to disable the event themselves.

from microsoft-authentication-extensions-for-dotnet.

bgavrilMS avatar bgavrilMS commented on July 22, 2024

Fixed in https://www.nuget.org/packages/Microsoft.Identity.Client.Extensions.Msal/2.10.0-preview

from microsoft-authentication-extensions-for-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.