How determine if application is web application

后端 未结 5 1436
轻奢々
轻奢々 2020-11-29 06:39

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 sessi

5条回答
  •  囚心锁ツ
    2020-11-29 07:04

    Just so no one else are making the same mistake as me.

    Assembly.GetEntryAssembly() do not work to define if its an web application or a not. When it's running as a service then Assembly.GetEntryAssembly() are null, but when i debug from VS, it's not null.

提交回复
热议问题