FileNotFoundException'

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Kirk

    FileNotFoundException'

    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


  • Angel J. Hernández M.

    #2
    Re: FileNotFoundExc eption'

    Hi there... You can fix this by reinstalling the .NET Framework.

    Regards,


    --
    Angel J. Hernández M.
    MCP - MCAD - MCSD - MCDBA

    ¿Sabes cómo proteger tu empresa de un ciberataque? En Consein te guiamos paso a paso con estrategias efectivas para una defensa sólida. Protégete ahora Únicos en Venezuela:Expertos en Migración de Infraestructura y Bases de Datos a Microsoft Azure Ofrecemos a nuestros clientes migración segura y eficiente a Azure, optimización de costos, mejor rendimiento, tecnologías avanzadas, […]



    "Peter Kirk" <pk@alpha-solutions.dk> wrote in message
    news:u7D6F%23Zd FHA.2124@TK2MSF TNGP14.phx.gbl. ..[color=blue]
    > 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
    >[/color]


    Comment

    • Peter Kirk

      #3
      Re: FileNotFoundExc eption'

      Do I have to uninstall first?

      "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en meddelelse
      news:e28EnCadFH A.1504@TK2MSFTN GP15.phx.gbl...[color=blue]
      > 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:u7D6F%23Zd FHA.2124@TK2MSF TNGP14.phx.gbl. ..[color=green]
      >> 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
      >>[/color]
      >
      >[/color]


      Comment

      • Adam Clauss

        #4
        Re: FileNotFoundExc eption'

        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:eEBGuNadFH A.3932@TK2MSFTN GP12.phx.gbl...[color=blue]
        > Do I have to uninstall first?
        >
        > "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en meddelelse
        > news:e28EnCadFH A.1504@TK2MSFTN GP15.phx.gbl...[color=green]
        >> 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:u7D6F%23Zd FHA.2124@TK2MSF TNGP14.phx.gbl. ..[color=darkred]
        >>> 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
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        • Peter Kirk

          #5
          Re: FileNotFoundExc eption'

          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@tamu.e du> skrev i en meddelelse
          news:11bdknrl1d k1l5d@corp.supe rnews.com...[color=blue]
          >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:eEBGuNadFH A.3932@TK2MSFTN GP12.phx.gbl...[color=green]
          >> Do I have to uninstall first?
          >>
          >> "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en meddelelse
          >> news:e28EnCadFH A.1504@TK2MSFTN GP15.phx.gbl...[color=darkred]
          >>> 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:u7D6F%23Zd FHA.2124@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
          >>>>
          >>>
          >>>[/color]
          >>
          >>[/color]
          >
          >[/color]


          Comment

          • Adam Clauss

            #6
            Re: FileNotFoundExc eption'

            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:%236XOMVad FHA.3712@TK2MSF TNGP09.phx.gbl. ..[color=blue]
            > 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@tamu.e du> skrev i en meddelelse
            > news:11bdknrl1d k1l5d@corp.supe rnews.com...[color=green]
            >>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:eEBGuNadFH A.3932@TK2MSFTN GP12.phx.gbl...[color=darkred]
            >>> Do I have to uninstall first?
            >>>
            >>> "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en meddelelse
            >>> news:e28EnCadFH A.1504@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:u7D6F%23Zd FHA.2124@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
            >>>>>
            >>>>
            >>>>
            >>>
            >>>[/color]
            >>
            >>[/color]
            >
            >[/color]


            Comment

            • Adam Clauss

              #7
              Re: FileNotFoundExc eption'

              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@tamu.e du> wrote in message
              news:11bdlrnauc khof0@corp.supe rnews.com...[color=blue]
              > 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:%236XOMVad FHA.3712@TK2MSF TNGP09.phx.gbl. ..[color=green]
              >> 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@tamu.e du> skrev i en meddelelse
              >> news:11bdknrl1d k1l5d@corp.supe rnews.com...[color=darkred]
              >>>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:eEBGuNadFH A.3932@TK2MSFTN GP12.phx.gbl...
              >>>> Do I have to uninstall first?
              >>>>
              >>>> "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en
              >>>> meddelelse news:e28EnCadFH A.1504@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:u7D6F%23Zd FHA.2124@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
              >>>>>>
              >>>>>
              >>>>>
              >>>>
              >>>>
              >>>
              >>>[/color]
              >>
              >>[/color]
              >
              >[/color]


              Comment

              • Peter Kirk

                #8
                Re: FileNotFoundExc eption'

                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" <cabadam@tamu.e du> skrev i en meddelelse
                news:11bdm17hol kk085@corp.supe rnews.com...[color=blue]
                > 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@tamu.e du> wrote in message
                > news:11bdlrnauc khof0@corp.supe rnews.com...[color=green]
                >> 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:%236XOMVad FHA.3712@TK2MSF TNGP09.phx.gbl. ..[color=darkred]
                >>> 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@tamu.e du> skrev i en meddelelse
                >>> news:11bdknrl1d k1l5d@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:eEBGuNadFH A.3932@TK2MSFTN GP12.phx.gbl...
                >>>>> Do I have to uninstall first?
                >>>>>
                >>>>> "Angel J. Hernández M." <angeljesus14@h otmail.com> skrev i en
                >>>>> meddelelse news:e28EnCadFH A.1504@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:u7D6F%23Zd FHA.2124@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
                >>>>>>>
                >>>>>>
                >>>>>>
                >>>>>
                >>>>>
                >>>>
                >>>>
                >>>
                >>>[/color]
                >>
                >>[/color]
                >
                >[/color]


                Comment

                • Adam Clauss

                  #9
                  Re: FileNotFoundExc eption'

                  > My program really only knows the interface, but I need to reference the[color=blue]
                  > 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?[/color]

                  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


                  Comment

                  Working...