Re: Can't load a file from a dll under ASPX pages
From: Girish Bharadwaj (girishb_at_mvps.org)
Date: 09/21/04
- Next message: Brett Hofer: "Re: Double Quotes in C# - Prob something simple but I feel im going crazy"
- Previous message: Scott Allen: "Re: Instatiating an object in the get property method"
- In reply to: Plon Plon: "Can't load a file from a dll under ASPX pages"
- Next in thread: C.G. Oh: "Re: Can't load a file from a dll under ASPX pages"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 21 Sep 2004 14:24:13 -0400
You should not use the location. You need to use the PhysicalPath, or
ApplicationPath or some such thing that exists server side on to get the
path ( Or you can use Server.MapPath(null) to get the current application
directory).
The location of the assembly will be some cache directory (to support shadow
copy implementation) as you found out.
-- Girish Bharadwaj http://msmvps.com/gbvb "Plon Plon" <plonplon@netcourrier.com> wrote in message news:uc0goy$nEHA.2764@TK2MSFTNGP11.phx.gbl... > Hi all, > > I currently have a problem that looks too strange for me, can someone > help me? > > I'm running an ASPX page that calls a C# component (DLL), and this DLL > works with an XML file. > I've placed the XML file and the C# component in a directory (i can't do > it different, and the installation path can be changed at each > installation)), and the component loads the XML by getting the > "location" property on the assembly object: > > Assembly ca = typeof(myObjType).Assembly; > string TheRightPath=ca.Location; > > Then my ASPX page uses the component to call some of its methods, and i > get the following error in my browser (i traduced the messages, i get > them in french): > > Server in error in application '/MyWebApplication'. -------------------- > Impossible to find file > "c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net > files\MyWebApplication\c4e535bc\84b07167\assembly\dl2\5801a542\022a2a6f_ > f79fc401\MyXmlFile.xml". > > I think IIS creates an "execution folder", where the loading of the XML > doesn't work anymore, because the executed DLL is not in the same folder > as the xml... > > Thanks for your help... > > > > > *** Sent via Developersdex http://www.developersdex.com *** > Don't just participate in USENET...get rewarded for it!
- Next message: Brett Hofer: "Re: Double Quotes in C# - Prob something simple but I feel im going crazy"
- Previous message: Scott Allen: "Re: Instatiating an object in the get property method"
- In reply to: Plon Plon: "Can't load a file from a dll under ASPX pages"
- Next in thread: C.G. Oh: "Re: Can't load a file from a dll under ASPX pages"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|