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.
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
理解ASP.NET中无入口装配的概念
本文深入探讨了ASP.NET环境中不存在'入口装配'这一概念的原因,解释了代码执行方式及页面处理流程,强调了如何通过Assembly.GetExecutingAssembly方法访问正在执行的代码所在的装配。
101

被折叠的 条评论
为什么被折叠?



