Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > GetExecutingAssembly().Location and DLL called by WebService

Reply
Thread Tools

GetExecutingAssembly().Location and DLL called by WebService

 
 
Neil Macdonald [Intergraph]
Guest
Posts: n/a
 
      06-04-2004
I am attempting to load a file that is situated in the same directory as an assembly that is called via a webservice

string csfFilePath = System.Configuration.ConfigurationSettings.AppSett ings["CSFFilePath"]
if(csfFilePath==null || csfFilePath.Length==0

csfFilePath=System.IO.Path.GetDirectoryName(System .Reflection.Assembly.GetExecutingAssembly().Locati on) + @"\"

_csfFilePath=csfFilePath

The first line using System.Configuration returns null; This I have found out is because only exe's can use the .config files

However the GetExecutingAssembly().Location return
@"c:\windows\microsoft.net\framework\v1.1.4322\tem porary asp.net files\coordinatesystemtransformation\5e89ae88\c379 ab0\assembly\dl2\df021851\907b49ab_fb49c401\

Which I guess is where the webservice is executing

Perhaps I am going about this all the wrong way; I am running in debug and need to step through the assembly and ws code to test

Any advice would be much help..
------------------------------------------------------------------------------------------------------------
Neil Macdonal
Senior Software Enginee
IntelliWhere Product Development Centr

Intergraph Corporation (NASDAQ: INGR
Intergraph Mapping and Geospatial Solution
Level 3, 299 Coronation Drive, Milton QLD Australia
 
Reply With Quote
 
 
 
 
[MSFT]
Guest
Posts: n/a
 
      06-04-2004
Hi Neil,

GetExecutingAssembly() is also not for a web service. It will return a
temporary folder for web service to load referenced assemblies. To Get the
phisical location of your asxm file, you may try following code in your web
service:

Context.Server.MapPath(".")

And its referenced assemblies should be in this sub "bin" folder.

Luke
Microsoft Online Support

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




 
Reply With Quote
 
 
 
 
Neil Macdonald [Intergraph]
Guest
Posts: n/a
 
      06-04-2004
yep, this works @ run time. How does this work @ debug

my project structure is

\solution\webserviceprojec
\solution\assemblyprojec

files are built to \solution\build (this is common to both projects, but only the assembly delivers files to here

I need to step through both the webservice and the referenced assembly (currently as a project reference

------------------------------------------------------------------------------------------------------------
Neil Macdonal
Senior Software Enginee
IntelliWhere Product Development Centr

Intergraph Corporation (NASDAQ: INGR
Intergraph Mapping and Geospatial Solution
Level 3, 299 Coronation Drive, Milton QLD Australia
 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-07-2004
Hi Neil,

Please feel free to correct me if I have misunderstood this. Based on my
understanding, you are working with a web serivce project, and its asmx
file should be in a virtual diretory, its assembly file (dll) should be in
a "bin" folder. However, from your description, they are in
"\solution\build". Can you explain more on this?

Regards,

Luke
Microsoft Online Support

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

 
Reply With Quote
 
Neil Macdonald [Intergraph]
Guest
Posts: n/a
 
      06-08-2004
- I have one solution containing both the DLL/Assembly and the WebServic
- When I call GetExecutingAssembly() in the DLL it gives me the ASP.NET temp directory not the directory of where the dll i
- Both project outputs are set t \Solution\Buil
- I need to load an xml .config file in the DLL on initialization this currently is in the \build directory, along with the compiled project output (dll
- I want to be able to step through the code in both the webservice and DLL and return the right results

I am sure it is a simple solution

------------------------------------------------------------------------------------------------------------
Neil Macdonal
Senior Software Enginee
IntelliWhere Product Development Centr

Intergraph Corporation (NASDAQ: INGR
Intergraph Mapping and Geospatial Solution
Level 3, 299 Coronation Drive, Milton QLD Australia
 
Reply With Quote
 
[MSFT]
Guest
Posts: n/a
 
      06-08-2004
Hi Neil,

If you just want get the DLL's path, you may try following code in the
Class library:

System.Reflection.Assembly.GetAssembly( this.GetType() ).CodeBase.ToString()

Luke
Microsoft Online Support

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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WebService called by automation dll times out when being called from Navision Felix ASP .Net Web Services 1 09-29-2006 01:43 PM
How to determine if a DLL is a COM DLL or .NET DLL Anushi ASP .Net 5 10-28-2004 01:59 PM
Why does Ruby use both tcl83.dll and tk83.dll (instead of just tk83.dll)? H. Simpson Ruby 4 08-03-2004 04:45 PM
mprapi.dll --> samlib.dll --> ntdll.dll issue. Some1 Computer Support 4 04-05-2004 02:02 AM
msvcrt.dll, msvcirt.dll, msvcrt20.dll and msvcrt40.dll, explanation please! Snoopy NZ Computing 16 08-25-2003 12:34 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57