For others: certain functions of CaptainCasa are only available if running in the request/response processing (e.g. the http-session).
If you open an own thread during this http-session then this own thread will not be connected to the session environment. So functions using HttpSessionContext will likely fail.
Solution: you need to explicitly pass the context information that you require in the own thread into this thread's processing.
Kind regards! Björn
PS: There are certain parts of context management where CaptainCasa provides some default mechanism: current user/ current tenant (interface IUserAccess/ITenantAccess): DefaultUserAccess and DefaultTenantAccess can be associated with the current session and/or the current thread. - But there is no general way to bind all existing session