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.GetEntryAssembly() 在asp.net 中不能用的原因
最新推荐文章于 2024-10-29 09:39:43 发布
本文探讨了ASP.NET中页面处理的方式及Assembly的加载过程。解释了为什么ASP.NET内部没有入口Assembly的概念,并介绍了如何使用Assembly.GetExecutingAssembly方法来获取当前正在执行的Assembly。
1335

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



