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




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

你可能感兴趣的:(.net,asp.net,Access,asp,IIS)