PC Review


Reply
Thread Tools Rate Thread

Debuging ASP.NET application with VS 2008 and relative filenames

 
 
blescouet
Guest
Posts: n/a
 
      25th May 2009
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.
 
Reply With Quote
 
 
 
 
Mr. Arnold
Guest
Posts: n/a
 
      25th May 2009

"blescouet" <(E-Mail Removed)> wrote in message
news:eRQ%(E-Mail Removed)...
> 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



 
Reply With Quote
 
Mr. Arnold
Guest
Posts: n/a
 
      25th May 2009

"blescouet" <(E-Mail Removed)> wrote in message
news:eRQ%(E-Mail Removed)...
> 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



 
Reply With Quote
 
blescouet
Guest
Posts: n/a
 
      25th May 2009
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.
 
Reply With Quote
 
blescouet
Guest
Posts: n/a
 
      25th May 2009
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.
 
Reply With Quote
 
Jack Jackson
Guest
Posts: n/a
 
      26th May 2009
On Mon, 25 May 2009 17:03:58 +0200, blescouet
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Jack Jackson
Guest
Posts: n/a
 
      26th May 2009
On Mon, 25 May 2009 17:03:58 +0200, blescouet
<(E-Mail Removed)> 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.
 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      26th May 2009
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


 
Reply With Quote
 
Andrew Morton
Guest
Posts: n/a
 
      26th May 2009
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


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Debuging ASP.NET application with VS 2008 and relative filenames blescouet Microsoft Dot NET 0 25th May 2009 03:07 PM
Debuging ASP.NET in Visual Studio 2008 Jason Microsoft C# .NET 6 24th May 2009 02:08 AM
Debuging ASP.NET in Visual Studio 2008 Jason Microsoft C# .NET 0 21st May 2009 09:37 PM
Dynamic Filenames with Application.Run weswheeldon@gmail.com Microsoft Excel Programming 1 7th Oct 2005 06:27 PM
how to step through code when debuging a dll in a VS .net CF application wiredless Microsoft Dot NET Compact Framework 1 8th Sep 2004 09:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:29 PM.