Hi,
In a class library that may be consumed by .exe as well as web applications,
I need to determine the "main" or "entry" assembly of the current
application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce the
main assembly of a currently executing web application, for example
"c:\inetpub\wwwroot\my.site.dll" (which would be better than a temporary
"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Temp orary ASP.NET
Files\my.site\934aac6a\e239367\kmbnrlfj.dll" or whatever path -- which I
don't get either, GetEntryAssembly simply returns null in a web context).
Any ideas?
Many thanks,
Phil 5 3186
How about Process.GetCurrentProcess().ProcessName? Is that the info
you are after?
--
Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 16:16:04 +0100, "Philipp Schumann"
<ph**@mokka.org> wrote: Hi,
In a class library that may be consumed by .exe as well as web applications, I need to determine the "main" or "entry" assembly of the current application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce the main assembly of a currently executing web application, for example "c:\inetpub\wwwroot\my.site.dll" (which would be better than a temporary "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Tem porary ASP.NET Files\my.site\934aac6a\e239367\kmbnrlfj.dll" or whatever path -- which I don't get either, GetEntryAssembly simply returns null in a web context).
Any ideas? Many thanks, Phil
Hi Scott,
thanks, but for a web application, this would probably be inetinfo.exe or
the ASP.NET worker process. What I want is the Assembly that provides the
entry point for the application, which is a DLL in web applications.
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag
news:qn********************************@4ax.com... How about Process.GetCurrentProcess().ProcessName? Is that the info you are after?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 16:16:04 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
Hi,
In a class library that may be consumed by .exe as well as web applications, I need to determine the "main" or "entry" assembly of the current application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce the main assembly of a currently executing web application, for example "c:\inetpub\wwwroot\my.site.dll" (which would be better than a temporary "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Te mporary ASP.NET Files\my.site\934aac6a\e239367\kmbnrlfj.dll" or whatever path -- which I don't get either, GetEntryAssembly simply returns null in a web context).
Any ideas? Many thanks, Phil
Right, ok.
I can see GetEntryAssembly returns null for me too.
Perhaps this is a questions of which assembly is really the 'entry'
assembly. Would the entry assembly be the assembly created when the
code behind files were compiled? Or the assembly created when the
first request arrives and ASPX pages are codegen'ed and compiled? I'm
not sure what the answer would be.
--
Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 18:27:32 +0100, "Philipp Schumann"
<ph**@mokka.org> wrote: Hi Scott,
thanks, but for a web application, this would probably be inetinfo.exe or the ASP.NET worker process. What I want is the Assembly that provides the entry point for the application, which is a DLL in web applications.
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag news:qn********************************@4ax.com.. . How about Process.GetCurrentProcess().ProcessName? Is that the info you are after?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 16:16:04 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
Hi,
In a class library that may be consumed by .exe as well as web applications, I need to determine the "main" or "entry" assembly of the current application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce the main assembly of a currently executing web application, for example "c:\inetpub\wwwroot\my.site.dll" (which would be better than a temporary "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\T emporary ASP.NET Files\my.site\934aac6a\e239367\kmbnrlfj.dll" or whatever path -- which I don't get either, GetEntryAssembly simply returns null in a web context).
Any ideas? Many thanks, Phil
Hi Scott,
well, generally speaking I wouldn't be sure, but for my special case, I'm
looking for the former and completely ignore the latter case. Although quite
often, both seems to be the case anyway - people have app-specific
code-behind logic in a web app DLL, but that app also has aspx and ascx
associated with it, which can be changed on the fly, with the appropriate
assemblies
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag
news:k6********************************@4ax.com... Right, ok.
I can see GetEntryAssembly returns null for me too.
Perhaps this is a questions of which assembly is really the 'entry' assembly. Would the entry assembly be the assembly created when the code behind files were compiled? Or the assembly created when the first request arrives and ASPX pages are codegen'ed and compiled? I'm not sure what the answer would be.
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 18:27:32 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
Hi Scott,
thanks, but for a web application, this would probably be inetinfo.exe or the ASP.NET worker process. What I want is the Assembly that provides the entry point for the application, which is a DLL in web applications.
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag news:qn********************************@4ax.com. .. How about Process.GetCurrentProcess().ProcessName? Is that the info you are after?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 16:16:04 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
Hi,
In a class library that may be consumed by .exe as well as web applications, I need to determine the "main" or "entry" assembly of the current application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce the main assembly of a currently executing web application, for example "c:\inetpub\wwwroot\my.site.dll" (which would be better than a temporary "C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\ Temporary ASP.NET Files\my.site\934aac6a\e239367\kmbnrlfj.dll" or whatever path -- which I don't get either, GetEntryAssembly simply returns null in a web context).
Any ideas? Many thanks, Phil
being re-compiled during the next web request...
"Philipp Schumann" <ph**@mokka.org> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP15.phx.gbl... Hi Scott,
well, generally speaking I wouldn't be sure, but for my special case, I'm looking for the former and completely ignore the latter case. Although quite often, both seems to be the case anyway - people have app-specific code-behind logic in a web app DLL, but that app also has aspx and ascx associated with it, which can be changed on the fly, with the appropriate assemblies
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag news:k6********************************@4ax.com... Right, ok.
I can see GetEntryAssembly returns null for me too.
Perhaps this is a questions of which assembly is really the 'entry' assembly. Would the entry assembly be the assembly created when the code behind files were compiled? Or the assembly created when the first request arrives and ASPX pages are codegen'ed and compiled? I'm not sure what the answer would be.
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 18:27:32 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
Hi Scott,
thanks, but for a web application, this would probably be inetinfo.exe or the ASP.NET worker process. What I want is the Assembly that provides the entry point for the application, which is a DLL in web applications.
"Scott Allen" <sc***@nospam.odetocode.com> schrieb im Newsbeitrag news:qn********************************@4ax.com ... How about Process.GetCurrentProcess().ProcessName? Is that the info you are after?
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 30 Mar 2005 16:16:04 +0100, "Philipp Schumann" <ph**@mokka.org> wrote:
>Hi, > >In a class library that may be consumed by .exe as well as web >applications, >I need to determine the "main" or "entry" assembly of the current >application. Unfortunately, Assembly.GetEntryAssembly() doesn't produce >the >main assembly of a currently executing web application, for example >"c:\inetpub\wwwroot\my.site.dll" (which would be better than a >temporary >"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 \Temporary ASP.NET >Files\my.site\934aac6a\e239367\kmbnrlfj.dll " or whatever path -- which >I >don't get either, GetEntryAssembly simply returns null in a web >context). > >Any ideas? >Many thanks, >Phil >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Terence Shek |
last post by:
Is there a way to set the application binding policy so
that it always binds to the latest version of an
assembly? I'm hoping there is a way to avoid updating the
application's binding...
|
by: Carlos G Benevides |
last post by:
I have a ASP.Net web application that has two assemblies that run
under com+. Under Windows 2000 the two assemblies are added to com+
automatically when instantiated from the web site. For this...
|
by: Scott Chang |
last post by:
Hi all,
I have Microsoft Visual C++ .NET (2002) program that is
installed on my Windows XP Professional Operating System
PC. I started my project (named HelloMCPP)in the Managed
C++ Application...
|
by: TRI_CODER |
last post by:
I am trying to solve the following exception. The exception occurs when my
ASP.NET code behind code attemtps to access a remore site using SSL. Please
note that all certificates are valid and the...
|
by: Andrew |
last post by:
In ASP.NET 1.1 I used to retreive the version of my code-behind assembly
using following syntax:
Assembly.GetExecutingAssembly().GetName().Version
The version was defined in AssemblyInfo.cs using...
|
by: Mike in Santa Rosa |
last post by:
I'm trying to get a simple c# app built that can launch/manipulate an excel
workbook, sheet. I've chased down several examples and can't any of them to
work. So I must be doing somethnig obviouslt...
|
by: Lung.S.wu |
last post by:
Hi all,
It is a history question.
Recently, I read the book "C A reference manual, third edition".
In this book, it list all C language keyword, and one is "entry".
I know it is omitted from...
|
by: =?Utf-8?B?R2Vvcmdl?= |
last post by:
Hello everyone,
I am a developer from C++ COM to C# COM. I feel confused about the entry
point function for a C# COM object.
In C++, we always initialize object through GetClassObject or...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |