474,039 Members | 49,438 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

FileNotFoundExc eption'

Hi, when I run my c# program I get this error:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred in
mscorlib.dll.
Additional information: File or assembly ASolutions.Dire ctory.Service or one
of its dependencies was not found.

Great... but how do I find out exactly what could not be found? (I am using
several libraries, which also use other libraries, and I would really like
to know what it is I need to find).

Thanks,
Peter
Nov 17 '05 #1
8 8931
Hi there... You can fix this by reinstalling the .NET Framework.

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, when I run my c# program I get this error:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred
in mscorlib.dll.
Additional information: File or assembly ASolutions.Dire ctory.Service or
one of its dependencies was not found.

Great... but how do I find out exactly what could not be found? (I am
using several libraries, which also use other libraries, and I would
really like to know what it is I need to find).

Thanks,
Peter

Nov 17 '05 #2
Do I have to uninstall first?

"Angel J. Hernández M." <an**********@h otmail.com> skrev i en meddelelse
news:e2******** ******@TK2MSFTN GP15.phx.gbl...
Hi there... You can fix this by reinstalling the .NET Framework.

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, when I run my c# program I get this error:

An unhandled exception of type 'System.IO.File NotFoundExcepti on' occurred
in mscorlib.dll.
Additional information: File or assembly ASolutions.Dire ctory.Service or
one of its dependencies was not found.

Great... but how do I find out exactly what could not be found? (I am
using several libraries, which also use other libraries, and I would
really like to know what it is I need to find).

Thanks,
Peter


Nov 17 '05 #3
I don't think that's the problem. I've seen this problem occur many times
just because some DLL is in the wrong place.

Try searching for a program called "Dependency Walker" (google should be
able to find it).
Run that and load the ASolutions.Dire ctory.Service module. It should tell
you if any of it's dependencies are missing.

---
Adam Clauss
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
Do I have to uninstall first?

"Angel J. Hernández M." <an**********@h otmail.com> skrev i en meddelelse
news:e2******** ******@TK2MSFTN GP15.phx.gbl...
Hi there... You can fix this by reinstalling the .NET Framework.

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, when I run my c# program I get this error:

An unhandled exception of type 'System.IO.File NotFoundExcepti on'
occurred in mscorlib.dll.
Additional information: File or assembly ASolutions.Dire ctory.Service or
one of its dependencies was not found.

Great... but how do I find out exactly what could not be found? (I am
using several libraries, which also use other libraries, and I would
really like to know what it is I need to find).

Thanks,
Peter



Nov 17 '05 #4
Hi, thanks. I didn't really think that was the problem either.

It turns out one of the libraries I use instantiates a class using
reflection (from configuration).

I need to make sure that that class is "referenced " by my main program class
(even though I'm not directly using it).

Peter

"Adam Clauss" <ca*****@tamu.e du> skrev i en meddelelse
news:11******** *****@corp.supe rnews.com...
I don't think that's the problem. I've seen this problem occur many times
just because some DLL is in the wrong place.

Try searching for a program called "Dependency Walker" (google should be
able to find it).
Run that and load the ASolutions.Dire ctory.Service module. It should tell
you if any of it's dependencies are missing.

---
Adam Clauss
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
Do I have to uninstall first?

"Angel J. Hernández M." <an**********@h otmail.com> skrev i en meddelelse
news:e2******** ******@TK2MSFTN GP15.phx.gbl...
Hi there... You can fix this by reinstalling the .NET Framework.

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, when I run my c# program I get this error:

An unhandled exception of type 'System.IO.File NotFoundExcepti on'
occurred in mscorlib.dll.
Additional information: File or assembly ASolutions.Dire ctory.Service
or one of its dependencies was not found.

Great... but how do I find out exactly what could not be found? (I am
using several libraries, which also use other libraries, and I would
really like to know what it is I need to find).

Thanks,
Peter



Nov 17 '05 #5
Odd, typically Visual Studio catches missing references on compilation and
will throw an error there. Wonder why this one got through...

Adam Clauss

"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi, thanks. I didn't really think that was the problem either.

It turns out one of the libraries I use instantiates a class using
reflection (from configuration).

I need to make sure that that class is "referenced " by my main program
class (even though I'm not directly using it).

Peter

"Adam Clauss" <ca*****@tamu.e du> skrev i en meddelelse
news:11******** *****@corp.supe rnews.com...
I don't think that's the problem. I've seen this problem occur many times
just because some DLL is in the wrong place.

Try searching for a program called "Dependency Walker" (google should be
able to find it).
Run that and load the ASolutions.Dire ctory.Service module. It should
tell you if any of it's dependencies are missing.

---
Adam Clauss
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
Do I have to uninstall first?

"Angel J. Hernández M." <an**********@h otmail.com> skrev i en meddelelse
news:e2******** ******@TK2MSFTN GP15.phx.gbl...
Hi there... You can fix this by reinstalling the .NET Framework.

Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA
http://groups.msn.com/desarrolladoresmiranda
http://www.consein.com
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
> Hi, when I run my c# program I get this error:
>
> An unhandled exception of type 'System.IO.File NotFoundExcepti on'
> occurred in mscorlib.dll.
> Additional information: File or assembly ASolutions.Dire ctory.Service
> or one of its dependencies was not found.
>
> Great... but how do I find out exactly what could not be found? (I am
> using several libraries, which also use other libraries, and I would
> really like to know what it is I need to find).
>
> Thanks,
> Peter
>



Nov 17 '05 #6
Never mind... misread the part about reflection. That would be why it
didn't catch it.

Glad you got it working!

---
Adam Clauss

"Adam Clauss" <ca*****@tamu.e du> wrote in message
news:11******** *****@corp.supe rnews.com...
Odd, typically Visual Studio catches missing references on compilation and
will throw an error there. Wonder why this one got through...

Adam Clauss

"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi, thanks. I didn't really think that was the problem either.

It turns out one of the libraries I use instantiates a class using
reflection (from configuration).

I need to make sure that that class is "referenced " by my main program
class (even though I'm not directly using it).

Peter

"Adam Clauss" <ca*****@tamu.e du> skrev i en meddelelse
news:11******** *****@corp.supe rnews.com...
I don't think that's the problem. I've seen this problem occur many
times just because some DLL is in the wrong place.

Try searching for a program called "Dependency Walker" (google should be
able to find it).
Run that and load the ASolutions.Dire ctory.Service module. It should
tell you if any of it's dependencies are missing.

---
Adam Clauss
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
Do I have to uninstall first?

"Angel J. Hernández M." <an**********@h otmail.com> skrev i en
meddelelse news:e2******** ******@TK2MSFTN GP15.phx.gbl...
> Hi there... You can fix this by reinstalling the .NET Framework.
>
> Regards,
>
>
> --
> Angel J. Hernández M.
> MCP - MCAD - MCSD - MCDBA
> http://groups.msn.com/desarrolladoresmiranda
> http://www.consein.com
>
>
> "Peter Kirk" <pk@alpha-solutions.dk> wrote in message
> news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
>> Hi, when I run my c# program I get this error:
>>
>> An unhandled exception of type 'System.IO.File NotFoundExcepti on'
>> occurred in mscorlib.dll.
>> Additional information: File or assembly ASolutions.Dire ctory.Service
>> or one of its dependencies was not found.
>>
>> Great... but how do I find out exactly what could not be found? (I am
>> using several libraries, which also use other libraries, and I would
>> really like to know what it is I need to find).
>>
>> Thanks,
>> Peter
>>
>
>



Nov 17 '05 #7
Thanks - as it turns out I am directly using the instantiated class - I
wasn't thinking clearly.

I call a method in a library which returns me an object which implements a
specific interface (IDirectoryWatc h). The library finds out which concrete
class to instantiate from configuration and uses reflection to perform the
instantiation.

My program really only knows the interface, but I need to reference the
concrete class which is instantiated by the library ... odd, actually isn't
it? What happens if the library is altered (or just confugured differently)
and returns another type of object, but which still implements
IDirectoryWatch ? Do I need to recompile my program?

Hmm.

Peter

"Adam Clauss" <ca*****@tamu.e du> skrev i en meddelelse
news:11******** *****@corp.supe rnews.com...
Never mind... misread the part about reflection. That would be why it
didn't catch it.

Glad you got it working!

---
Adam Clauss

"Adam Clauss" <ca*****@tamu.e du> wrote in message
news:11******** *****@corp.supe rnews.com...
Odd, typically Visual Studio catches missing references on compilation
and will throw an error there. Wonder why this one got through...

Adam Clauss

"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Hi, thanks. I didn't really think that was the problem either.

It turns out one of the libraries I use instantiates a class using
reflection (from configuration).

I need to make sure that that class is "referenced " by my main program
class (even though I'm not directly using it).

Peter

"Adam Clauss" <ca*****@tamu.e du> skrev i en meddelelse
news:11******** *****@corp.supe rnews.com...
I don't think that's the problem. I've seen this problem occur many
times just because some DLL is in the wrong place.

Try searching for a program called "Dependency Walker" (google should
be able to find it).
Run that and load the ASolutions.Dire ctory.Service module. It should
tell you if any of it's dependencies are missing.

---
Adam Clauss
"Peter Kirk" <pk@alpha-solutions.dk> wrote in message
news:eE******** ******@TK2MSFTN GP12.phx.gbl...
> Do I have to uninstall first?
>
> "Angel J. Hernández M." <an**********@h otmail.com> skrev i en
> meddelelse news:e2******** ******@TK2MSFTN GP15.phx.gbl...
>> Hi there... You can fix this by reinstalling the .NET Framework.
>>
>> Regards,
>>
>>
>> --
>> Angel J. Hernández M.
>> MCP - MCAD - MCSD - MCDBA
>> http://groups.msn.com/desarrolladoresmiranda
>> http://www.consein.com
>>
>>
>> "Peter Kirk" <pk@alpha-solutions.dk> wrote in message
>> news:u7******** ********@TK2MSF TNGP14.phx.gbl. ..
>>> Hi, when I run my c# program I get this error:
>>>
>>> An unhandled exception of type 'System.IO.File NotFoundExcepti on'
>>> occurred in mscorlib.dll.
>>> Additional information: File or assembly
>>> ASolutions.Dire ctory.Service or one of its dependencies was not
>>> found.
>>>
>>> Great... but how do I find out exactly what could not be found? (I
>>> am using several libraries, which also use other libraries, and I
>>> would really like to know what it is I need to find).
>>>
>>> Thanks,
>>> Peter
>>>
>>
>>
>
>



Nov 17 '05 #8
> My program really only knows the interface, but I need to reference the
concrete class which is instantiated by the library ... odd, actually
isn't it? What happens if the library is altered (or just confugured
differently) and returns another type of object, but which still
implements IDirectoryWatch ? Do I need to recompile my program?


No, I don't think so - it isn't a compilation issue (thus why VS did not
catch it). Reflection is all at runtime, so if the library changes to
instantiate a class from some other DLL, that other DLL will have just need
to be in a place it can be located (aka: same directory, windows/system32,
etc).

If you have access to the library code, you might test that by writing up a
quick new library with a class that implements the interface and try to
instatiate it without recompiling your app. Better to be safe than sorry
later :)

--
Adam Clauss
Nov 17 '05 #9

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

Similar topics

1
6726
by: ulf | last post by:
Hello, After I got a FileNotFoundException in my real life CSharp code, I nailed it down to the following line: System.EnterpriseServices.ResourcePool rp = new System.EnterpriseServices.ResourcePool(null); The exception I get for this line is System.IO.FileNotFoundException: The specified module could not be found.
2
3878
by: Michael Sanford | last post by:
I'm getting a Sysmte.IO.FileNotFoundException when executing the code below. It is straight from the example. This works on one machine, but not the other. Other benign calls invoke the same misbehavior which as ActiveWorkbook or Active Worksheet. Please help! peace, - mike
0
1647
by: Daylor | last post by:
any suggestions, why FileNotFoundException is throw , when im try to send object from appdomain to other ? (the object inherits MarshalByRefObject) i dont have a clue what the VS.2003 want from me. i see the object is created OK ,but when the function return to the first appdomain, an FileNotFoundException is throw , and i can't even catch it...
3
2434
by: Nick | last post by:
Hello, Let me explain my situation. There is an application in C++ (that I didn't write) that needs to call a C# DLL. One option, I believe, would be to compile the app with the clr switch. Rather than do that first the other developer wondered if I could create an intermediate managed code DLL that would call my C# code. So, I created a C++ DLL that exports a function and compiled it with the clr switch. It calls my C# code. To test...
5
2277
by: MattC | last post by:
Hi, I am getting the following error: System.IO.FileNotFoundException: C:\Dreamtxt\WebSites\mysite\www\feedback.aspx at System.Web.UI.TemplateParser.GetParserCacheItem() at System.Web.UI.TemplateControlParser.CompileAndGetParserCacheItem(String virtualPath, String inputFile, HttpContext context) at System.Web.UI.TemplateControlParser.GetCompiledInstance(String virtualPath,
3
9103
by: James | last post by:
Hi guys Do you ever get the exception in Managed C++? How can I know which file or dll is missed?
5
38385
by: SGRing | last post by:
I have a c# application that I'm migrating from 2003 to 2005, and I moved it to another machine. It built ok. But, when trying to run I get System.IO.FileNotFoundException was unhandled Message="The specified module could not be found. (Exception from HRESULT: 0x8007007E)" when it tries to call a property in the file that it's in. But, there is no file information, and it never seems to get to the first line of the property in question....
0
1432
by: Peter Vestergaard | last post by:
Hi, I am running VS .Net 2005. I have an application in which one of the classes are having a member that is an instance of a class defined in a managed C++ dll. As soon as I try to create an instance of the local class I get a FileNotFoundException not telling much more than the file cannot be found. I have made the below code that reproduces this behaviour. What I don't understand is that the debugger is reporting that the...
2
7979
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer. When someone else uses the web app and tries to open a file using the remote server the error below happens. any help? **Code** C# - filepath is a valid file name which is passed via the form. System.IO.BinaryReader br = new...
2
3121
by: bbindae | last post by:
I am trying to check whether XmlTextReader reads the xml file successfully or not. MSDN says that XmlTextReader raise the FileNotFoundException when it cannot find the file to read. Here is the source code I wrote. string fileName = "thisfileneverexist.xml"; XmlTextReader xmlReader = null;
0
10331
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
12129
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11594
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
11135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8686
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6646
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
5402
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3956
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.