`
kevinhrw
  • 浏览: 192084 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

Assembly.GetEntryAssembly() 在UG-DLL或ASP.net中不能用

    博客分类:
  • C#
阅读更多



Inside ASP.NET there is no concept of an "entry assembly", because the code that is executing was not started by a call to AppDomain.ExecuteAssembly.

Rather, it is loaded into an app domain created by the ISAPI filter that supplies ASP.NET support to IIS. The new app domain is then

A web page in an asp.net application is ultimately a class that implements the IHttpHandler interface. When asp.net processes a request, it just constructs a new instance of the class corresponding to the page being visited and executes its ProcessRequest method.

Nowhere in that process is an assemblies managed entry point executed (which is required for GetEntryAssembly to work)

However, if you are trying to access the assembly that contains the code being executed, you can use the Assembly.GetExecutingAssembly method.
Assembly.GetExecutingAssembly
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics