Re: FileNotFoundException'



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 (IDirectoryWatch). 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" <cabadam@xxxxxxxx> skrev i en meddelelse
news:11bdm17holkk085@xxxxxxxxxxxxxxxxxxxxx
> 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" <cabadam@xxxxxxxx> wrote in message
> news:11bdlrnauckhof0@xxxxxxxxxxxxxxxxxxxxx
>> 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@xxxxxxxxxxxxxxxxxx> wrote in message
>> news:%236XOMVadFHA.3712@xxxxxxxxxxxxxxxxxxxxxxx
>>> 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" <cabadam@xxxxxxxx> skrev i en meddelelse
>>> news:11bdknrl1dk1l5d@xxxxxxxxxxxxxxxxxxxxx
>>>>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.Directory.Service module. It should
>>>> tell you if any of it's dependencies are missing.
>>>>
>>>> ---
>>>> Adam Clauss
>>>>
>>>>
>>>> "Peter Kirk" <pk@xxxxxxxxxxxxxxxxxx> wrote in message
>>>> news:eEBGuNadFHA.3932@xxxxxxxxxxxxxxxxxxxxxxx
>>>>> Do I have to uninstall first?
>>>>>
>>>>> "Angel J. Hernández M." <angeljesus14@xxxxxxxxxxx> skrev i en
>>>>> meddelelse news:e28EnCadFHA.1504@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>> 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@xxxxxxxxxxxxxxxxxx> wrote in message
>>>>>> news:u7D6F%23ZdFHA.2124@xxxxxxxxxxxxxxxxxxxxxxx
>>>>>>> Hi, when I run my c# program I get this error:
>>>>>>>
>>>>>>> An unhandled exception of type 'System.IO.FileNotFoundException'
>>>>>>> occurred in mscorlib.dll.
>>>>>>> Additional information: File or assembly
>>>>>>> ASolutions.Directory.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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>
>>
>>
>
>


.



Relevant Pages

  • Re: How to get imagebase after a DLL gets loaded
    ... how can you be unaware of the names of variables in DLL module that you ... Implementing a library that requires users of the library to instantiate ... predict what variable name you will use at initialization time. ... Some third-party libraries DO require that you instantiate a pre-defined ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How to get imagebase after a DLL gets loaded
    ... During the process of building the DLL, ... Implementing a library that requires users of the library to instantiate ... predict what variable name you will use at initialization time. ... Some third-party libraries DO require that you instantiate a pre-defined ...
    (microsoft.public.win32.programmer.kernel)
  • global variables in shared libraries
    ... to be included in Debian, I feel that I should not be slaughtered ... I have a question about shared libraries. ... I have come up with two ways to deal without global variables in C: ... The first is to expect the user to instantiate a struct, ...
    (Debian-User)
  • Re: Unit Testing in C++
    ... I'm quite curious on how you would go to perform unit testing in C++. ... One way is to use one of the 'lot' of libraries available for the ... Therefore you write a unti of test code to instantiate one or more instances ...
    (comp.programming)
  • Re: Passing template struct as an argument to a template function
    ... > types could be used to instantiate templates? ... Let's say that some of my template functions, ... > compiler is in no way a good idea. ... Majority of libraries on the market are still template-free. ...
    (comp.lang.cpp)