PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET
Debuging ASP.NET application with VS 2008 and relative filenames
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET
Debuging ASP.NET application with VS 2008 and relative filenames
![]() |
Debuging ASP.NET application with VS 2008 and relative filenames |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi all,
In an ASP.NET application, I'm using NHibernate with an external configuration file, located in the project directory. In my code, the name of this file is given to NHibernate without path (relative name). While debuging (with VS development Web Server), it throws a FileNotFoundException, trying to load the file from C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ as the base path, not from project's base path. My colleagues, with the same source, haven't any problem : the file is loaded from the project path. I suppose I have something different in the configuration of my VS, or my computer. But what, and Where ? I haven't any idea. B.L. |
|
|
|
#2 |
|
Guest
Posts: n/a
|
"blescouet" <jaimep@slespourriels.fr> wrote in message news:eRQ%23DlT3JHA.4272@TK2MSFTNGP06.phx.gbl... > Hi all, > In an ASP.NET application, I'm using NHibernate with an external > configuration file, located in the project directory. In my code, the name > of this file is given to NHibernate without path (relative name). While > debuging (with VS development Web Server), it throws a > FileNotFoundException, trying to load the file from C:\Program > Files\Microsoft Visual Studio 9.0\Common7\IDE\ as the base path, not from > project's base path. > My colleagues, with the same source, haven't any problem : the file is > loaded from the project path. > I suppose I have something different in the configuration of my VS, or my > computer. But what, and Where ? I haven't any idea. > In nine cases out of ten, that 'FileNotFoundException' usually means there is a reference to a DLL, a DLL calling another DLL, and the called DLL is not on the machine. __________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com |
|
|
|
#3 |
|
Guest
Posts: n/a
|
"blescouet" <jaimep@slespourriels.fr> wrote in message news:eRQ%23DlT3JHA.4272@TK2MSFTNGP06.phx.gbl... > Hi all, > In an ASP.NET application, I'm using NHibernate with an external > configuration file, located in the project directory. In my code, the name > of this file is given to NHibernate without path (relative name). While > debuging (with VS development Web Server), it throws a > FileNotFoundException, trying to load the file from C:\Program > Files\Microsoft Visual Studio 9.0\Common7\IDE\ as the base path, not from > project's base path. > My colleagues, with the same source, haven't any problem : the file is > loaded from the project path. > I suppose I have something different in the configuration of my VS, or my > computer. But what, and Where ? I haven't any idea. > In nine cases out of ten, that 'FileNotFoundException' usually means there is a reference to a DLL, a DLL calling another DLL, and the called DLL is not on the machine. __________ Information from ESET NOD32 Antivirus, version of virus signature database 4101 (20090525) __________ The message was checked by ESET NOD32 Antivirus. http://www.eset.com |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Mr. Arnold a écrit :
> > > In nine cases out of ten, that 'FileNotFoundException' usually means > there is a reference to a DLL, a DLL calling another DLL, and the called > DLL is not on the machine. > So I'm the tenth case ! It's not about loading assemblies. I have an XML file containing the NHibernante configuration. This file is placed in the project's directory. In my code, I'm passing the file name to NHibernate ("NHibernate.config"). And somewhere in his code, NHibernate uses this file name to create an XmlTextReader instance. Inspecting the BaseUri property of this instance gives "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\NHibernate.config" when I'm expecting "<site base directory>\NHibernate.config". B.L. |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Mr. Arnold a écrit :
> > > In nine cases out of ten, that 'FileNotFoundException' usually means > there is a reference to a DLL, a DLL calling another DLL, and the called > DLL is not on the machine. > So I'm the tenth case ! It's not about loading assemblies. I have an XML file containing the NHibernante configuration. This file is placed in the project's directory. In my code, I'm passing the file name to NHibernate ("NHibernate.config"). And somewhere in his code, NHibernate uses this file name to create an XmlTextReader instance. Inspecting the BaseUri property of this instance gives "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\NHibernate.config" when I'm expecting "<site base directory>\NHibernate.config". B.L. |
|
|
|
#6 |
|
Guest
Posts: n/a
|
On Mon, 25 May 2009 17:03:58 +0200, blescouet
<jaimep@slespourriels.fr> wrote: >Mr. Arnold a écrit : >> >> >> In nine cases out of ten, that 'FileNotFoundException' usually means >> there is a reference to a DLL, a DLL calling another DLL, and the called >> DLL is not on the machine. >> > >So I'm the tenth case ! It's not about loading assemblies. I have an XML >file containing the NHibernante configuration. This file is placed in >the project's directory. In my code, I'm passing the file name to >NHibernate ("NHibernate.config"). And somewhere in his code, NHibernate >uses this file name to create an XmlTextReader instance. Inspecting the >BaseUri property of this instance gives "C:\Program Files\Microsoft >Visual Studio 9.0\Common7\IDE\NHibernate.config" when I'm expecting >"<site base directory>\NHibernate.config". > >B.L. My understanding is that when you run a project in the IDE, it does not run from the project directory, but an internal VS directory. I have never been able to find anything that points to the true location of the project. |
|
|
|
#7 |
|
Guest
Posts: n/a
|
On Mon, 25 May 2009 17:03:58 +0200, blescouet
<jaimep@slespourriels.fr> wrote: >Mr. Arnold a écrit : >> >> >> In nine cases out of ten, that 'FileNotFoundException' usually means >> there is a reference to a DLL, a DLL calling another DLL, and the called >> DLL is not on the machine. >> > >So I'm the tenth case ! It's not about loading assemblies. I have an XML >file containing the NHibernante configuration. This file is placed in >the project's directory. In my code, I'm passing the file name to >NHibernate ("NHibernate.config"). And somewhere in his code, NHibernate >uses this file name to create an XmlTextReader instance. Inspecting the >BaseUri property of this instance gives "C:\Program Files\Microsoft >Visual Studio 9.0\Common7\IDE\NHibernate.config" when I'm expecting >"<site base directory>\NHibernate.config". > >B.L. My understanding is that when you run a project in the IDE, it does not run from the project directory, but an internal VS directory. I have never been able to find anything that points to the true location of the project. |
|
|
|
#8 |
|
Guest
Posts: n/a
|
blescouet wrote:
> So I'm the tenth case ! It's not about loading assemblies. I have an > XML file containing the NHibernante configuration. This file is > placed in the project's directory. In my code, I'm passing the file > name to NHibernate ("NHibernate.config"). Have you tried passing it Server.MapPath("~/NHibernate.config")? Andrew |
|
|
|
#9 |
|
Guest
Posts: n/a
|
blescouet wrote:
> So I'm the tenth case ! It's not about loading assemblies. I have an > XML file containing the NHibernante configuration. This file is > placed in the project's directory. In my code, I'm passing the file > name to NHibernate ("NHibernate.config"). Have you tried passing it Server.MapPath("~/NHibernate.config")? Andrew |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

