Skip to content

CSLA 8 can pick the aspnetcore IContextManager over Blazor #4208

@rockfordlhotka

Description

@rockfordlhotka

In a server-interactive page in Blazor 8, the ApplicationContextAccessor will sometimes pick the aspnetcore IContextManager when it should use the Blazor server context manager.

The constructor needs to walk backwards through the list of registered IContextManager services so it selects the one that is valid and is also the most recently added to the list.

      var managers = contextManagerList.ToList();
      for (int i = managers.Count - 1; i >= 0; i--)
      {
        if (managers[i].IsValid)
        {
          ContextManager = managers[i];
          break;
        }
      }
      ContextManager ??= new Core.ApplicationContextManagerAsyncLocal();

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions