Skip to content

.NET Maui and breadcrumbs in background task #2086

Answered by mattjohnsonpint
jenscski asked this question in Q&A
Discussion options

You must be logged in to vote

Some background first:

In MAUI applications, we force the IsGlobalMode option to true (you can't change it). This has the effect of there being only one global scope for the entire application. This is what we recommend for client-based applications in general (both mobile and desktop, and not just MAUI), because there are many situations where one thread needs to include breadcrumbs, tags, and other information set from another thread. For example, a UI thread might click a button that uses a background thread to call an API that authenticates the user. The resulting user id would be set in context on the scope, and available both to the background thread and to the original UI thread an…

Replies: 2 comments 3 replies

This comment has been hidden.

@jenscski
Comment options

@mattjohnsonpint
Comment options

Comment options

You must be logged in to vote
1 reply
@jenscski
Comment options

Answer selected by mattjohnsonpint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants