How can a .NET code know whether it is running within a web server application?

前端 未结 7 1490
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 02:49

I have a library code, which should be aware whether it is executed in the context of a web server or standalone application server.

The obvious that comes to mind i

7条回答
  •  一生所求
    2020-12-06 03:09

    • BrowserInteropHelper..::.IsBrowserHosted Property

    Gets a value that specifies whether the current Windows Presentation Foundation (WPF) application is browser hosted.

    Thats how its done in XBAP

    • Performing Browser Detection Using ASP.NET

    or if you have an appdomain do reflection and get something from it? using

    • Reflection CallContext

提交回复
热议问题