473,387 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get assembly path in asp.net

I have an external assembly that's access by an asp.net page. I want this assembly to load a xml configuration file, and I want to put this file in the same directory wich the assembly is located.

I tried to use System.Reflection.Assembly.GetExecutingAssembly(). Location to get the assembly directory, but it returned the temporary path asp.net uses to run the assembly. Something like "c:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net files\maindotnet\7b206850\749bb87\assembly\dl2\dcf 60b7c\72634910_1f97c301\".

Is there a way to retrieve the assembly original path?

Thanks!
Nov 17 '05 #1
4 8539
AppDomain.CurrentDomain.BaseDirectory

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sebastiao Pereira Filho" <__*****************@myrealbox.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
I have an external assembly that's access by an asp.net page. I want this
assembly to load a xml configuration file, and I want to put this file in
the same directory wich the assembly is located.

I tried to use System.Reflection.Assembly.GetExecutingAssembly(). Location to
get the assembly directory, but it returned the temporary path asp.net uses
to run the assembly. Something like
"c:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\maindotnet\7b206850\749bb87\assembly\dl2\dcf 60b7c\72634910_1f97c301\".

Is there a way to retrieve the assembly original path?

Thanks!
Nov 17 '05 #2
AppDomain.CurrentDomain.BaseDirectory

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sebastiao Pereira Filho" <__*****************@myrealbox.com> wrote in
message news:%2****************@TK2MSFTNGP12.phx.gbl...
I have an external assembly that's access by an asp.net page. I want this
assembly to load a xml configuration file, and I want to put this file in
the same directory wich the assembly is located.

I tried to use System.Reflection.Assembly.GetExecutingAssembly(). Location to
get the assembly directory, but it returned the temporary path asp.net uses
to run the assembly. Something like
"c:\winnt\microsoft.net\framework\v1.1.4322\tempor ary asp.net
files\maindotnet\7b206850\749bb87\assembly\dl2\dcf 60b7c\72634910_1f97c301\".

Is there a way to retrieve the assembly original path?

Thanks!
Nov 17 '05 #3
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uE**************@TK2MSFTNGP10.phx.gbl...
AppDomain.CurrentDomain.BaseDirectory


It worked perfectly! Thanks!
Nov 17 '05 #4
"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message news:uE**************@TK2MSFTNGP10.phx.gbl...
AppDomain.CurrentDomain.BaseDirectory


It worked perfectly! Thanks!
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: karunakar | last post by:
Hi All I am not able to read the class name I want read the particular class name string path = System.Configuration.ConfigurationSettings.AppSettings; string className = path + ".User";...
2
by: e_zverev | last post by:
Hi The question concerns the ways ASP.NET loads required assemblies into it's app domain. I know of a deprecated feature of clr assembly detection in which the use of environment variable...
10
by: jojobar | last post by:
Hello, I am trying to use vs.net 2005 to migrate a project originally in vs.net 2003. I started with creation of a "web site", and then created folders for each component of the site. I read...
2
by: Brad | last post by:
I have one of those seemingly simple questions that evades/confuses me. I've created an assembly with bass classes (classes meant to be inherited in other assemblys). In a secondary assembly (my...
1
by: Patrick | last post by:
Has been trying to get an ASP.NET DLL's modification date/time for the "release date/time" to be displayed on the page's footer Using: System.Reflection.Assembly...
2
by: Luis Arvayo | last post by:
I am compiling and executing c# code at runtime and I need to define in CompilerParameters.ReferencedAssemblies one of my own assemblies together with the standard System.dll u others. Example:...
2
by: Jeff | last post by:
Hi I'm trying to achieve a scenario where I have c# files that are compiled dynamically, the assemblies are then loaded in a different AppDomain, I call a simple method from the object, and then...
1
by: nish85 | last post by:
Hi, i have uploaded my sit to web server goddady.com i have a button to download dyanmically generated excel file.This button is ajax enabled.....When i am click on this button it will popup a...
7
by: chage | last post by:
Hi, I have been searching around to try adding reference assembly to another assembly during runtime, programatically. Is this possible in .Net? The reason for this is because i am having...
9
by: =?Utf-8?B?VGhvbWFzIFcuIEJyb3du?= | last post by:
"parez" wrote: Assembly.LoadWithPartialName does indeed work!! Now, why is this incredibly useful routine deprecated and we are instructed to use Assembly.Load instead which does not provide...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.