how do i get the root\bin directory using framework?

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

i want to be able to load a dll from the bin folder, but want a mechanism
that will work without directly specifying \bin, even with changes that come
with vs 2005.

i know i can use Request.ApplicationPath and then append \bin to it, but
don't want this method to break later if the compiled dll files don't always
go there.

is there a method i can call that gets the location of the dll file
directly?

thanks
 
I'm not sure but I think if you just use Assembly.Load (or one of the
overloads) it should probe for the bin folder automatically.
Look at the documentation on the various Load methods of the Assembly class.
Peter
 
thanks, I'll look.

Hey Peter, i've been to your site and i am impressed with it all. When i
google an issue and get an article from there i always know it will be good.
Keep up the good work
 
all of them are relative to the directory they are in and an absolute path
is necessary.

So would there be problems in vs 2005
 
Hi TS,

As for the ASP.NET's private assembly's probing path, it remains only the
sub "bin" dir. So if you just want to access assemblies there, you can just
concatenate the applicaiton's root dir's apth with "bin" ... e.g:

Server.MapPath("~/bin") can directly get the private bin dir of the current
running asp.net application...

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| From: "TS" <[email protected]>
| References: <epm0R#[email protected]>
<[email protected]>
| Subject: Re: how do i get the root\bin directory using framework?
| Date: Tue, 17 Jan 2006 13:34:18 -0600
| Lines: 43
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
| X-RFC2646: Format=Flowed; Original
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: 101nat080.tea.state.tx.us 198.214.101.80
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:371506
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| all of them are relative to the directory they are in and an absolute
path
| is necessary.
|
| So would there be problems in vs 2005
|
message
| | > I'm not sure but I think if you just use Assembly.Load (or one of the
| > overloads) it should probe for the bin folder automatically.
| > Look at the documentation on the various Load methods of the Assembly
| > class.
| > Peter
| >
| > --
| > Co-founder, Eggheadcafe.com developer portal:
| > http://www.eggheadcafe.com
| > UnBlog:
| > http://petesbloggerama.blogspot.com
| >
| >
| >
| >
| > "TS" wrote:
| >
| >> i want to be able to load a dll from the bin folder, but want a
mechanism
| >> that will work without directly specifying \bin, even with changes
that
| >> come
| >> with vs 2005.
| >>
| >> i know i can use Request.ApplicationPath and then append \bin to it,
but
| >> don't want this method to break later if the compiled dll files don't
| >> always
| >> go there.
| >>
| >> is there a method i can call that gets the location of the dll file
| >> directly?
| >>
| >> thanks
| >>
| >>
| >>
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top