In a core assembly, which is run both in a windows service, and in a web application, I need to store information per user session. The service will have a single user session, and the web application uses HttpContext.Current.
I want to configure which method to use within the core assembly - convention over configuration. I want to do this only once, and I believe HttpContext.Current will be null when run from Application_Start.
How can I reliably determine if the application is a web application?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…