How to resolve this FileNotFoundException?!

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • K Viltersten

    How to resolve this FileNotFoundException?!

    I'm getting this message.

    System.IO.FileN otFoundExceptio n was unhandled
    Message: It's not possible to load the file or
    assembly SomeName, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null or one of
    its dependencies. The file can not be found.

    When i run the file from where it's compiled
    to, it works. If i run the file from elsewhere,
    i end up getting this error.

    The above and the fact that i don't refer to
    SomeName from the source code, makes me guess
    that it's because i'm using it as a reference.

    Now, how can i resolve this problem?

    I'm a logic and class structure designer so
    the actual deployment is sometimes awkwardly
    incomprehensabl e to me. Please be gentle... :)

    --
    Regards
    Konrad Viltersten
    ----------------------------------------
    May all spammers die an agonizing death;
    have no burial places; their souls be
    chased by demons in Gehenna from one room
    to another for all eternity and beyond.


  • sloan

    #2
    Re: How to resolve this FileNotFoundExc eption?!


    Most times I get something like that...it means I'm referencing a file
    MySuperCoolAsse mbly.dll

    but, somewhere along the chain, there are 2 versions of
    MySuperCoolAsse mbly.dll

    and during project build, one project is overwriting the other.

    To try and resolve it:

    Put MySuperCoolAsse mbly.dll somewhere (new)
    c:\newfolder\My SuperCoolAssemb ly.dll

    Go through your projects.

    I would go through my solution, find all refs to MySuperCoolAsse mbly.dll,
    and then remove the ref, and then add it back in from
    c:\newfolder\My SuperCoolAssemb ly.dll

    Rebuild, try again.

    If it works, then you work your way back out of it,....
    remove the reference to
    c:\newfolder\My SuperCoolAssemb ly.dll
    and then rereference from its orginal location.
    Eventually, one will break.

    If you rebuild and it still craps...then you have some more dectective work
    to find where the (different version) of MySuperCoolAsse mbly.dll is coming
    from.

    I think that's is what is happening.


    ..............




    "K Viltersten" <tmp1@vilterste n.comwrote in message
    news:6jf64pF2vu ooU1@mid.indivi dual.net...
    I'm getting this message.
    >
    System.IO.FileN otFoundExceptio n was unhandled
    Message: It's not possible to load the file or
    assembly SomeName, Version=1.0.0.0 ,
    Culture=neutral , PublicKeyToken= null or one of
    its dependencies. The file can not be found.
    >
    When i run the file from where it's compiled
    to, it works. If i run the file from elsewhere,
    i end up getting this error.
    >
    The above and the fact that i don't refer to
    SomeName from the source code, makes me guess
    that it's because i'm using it as a reference.
    >
    Now, how can i resolve this problem?
    >
    I'm a logic and class structure designer so
    the actual deployment is sometimes awkwardly
    incomprehensabl e to me. Please be gentle... :)
    >
    --
    Regards
    Konrad Viltersten
    ----------------------------------------
    May all spammers die an agonizing death;
    have no burial places; their souls be
    chased by demons in Gehenna from one room
    to another for all eternity and beyond.
    >

    Comment

    • =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?=

      #3
      RE: How to resolve this FileNotFoundExc eption?!

      Mister, has you Copy Local = true in references ??

      Thanks.

      Comment

      • DaveL

        #4
        Re: How to resolve this FileNotFoundExc eption?!

        If the dll in question is not a common dll
        you need to place the dll with your Applicaion folder or sub folders

        If this is a common dll , whereas lots of other applications
        require it, check out placing it in the Gac

        Dave

        "K Viltersten" <tmp1@vilterste n.comwrote in message
        news:6jf64pF2vu ooU1@mid.indivi dual.net...
        I'm getting this message.
        >
        System.IO.FileN otFoundExceptio n was unhandled
        Message: It's not possible to load the file or
        assembly SomeName, Version=1.0.0.0 ,
        Culture=neutral , PublicKeyToken= null or one of
        its dependencies. The file can not be found.
        >
        When i run the file from where it's compiled
        to, it works. If i run the file from elsewhere,
        i end up getting this error.
        >
        The above and the fact that i don't refer to
        SomeName from the source code, makes me guess
        that it's because i'm using it as a reference.
        >
        Now, how can i resolve this problem?
        >
        I'm a logic and class structure designer so
        the actual deployment is sometimes awkwardly
        incomprehensabl e to me. Please be gentle... :)
        >
        --
        Regards
        Konrad Viltersten
        ----------------------------------------
        May all spammers die an agonizing death;
        have no burial places; their souls be
        chased by demons in Gehenna from one room
        to another for all eternity and beyond.
        >

        Comment

        • K Viltersten

          #5
          Re: How to resolve this FileNotFoundExc eption?!

          I'm not sure. Where in reference should it be?
          The folder with my references only shows the
          packages/files i've chosen to use...

          --
          Regards
          Konrad Viltersten
          ----------------------------------------
          May all spammers die an agonizing death;
          have no burial places; their souls be
          chased by demons in Gehenna from one room
          to another for all eternity and beyond.
          "Alhambra Eidos Desarrollo"
          <AlhambraEidosD esarrollo@discu ssions.microsof t.comskrev i meddelandet
          news:6FBF87C4-60D3-4EC8-98A5-62D5F45308EB@mi crosoft.com...
          Mister, has you Copy Local = true in references ??
          >
          Thanks.

          Comment

          • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

            #6
            Re: How to resolve this FileNotFoundExc eption?!

            Select the Assembly in the references folder in the project and then open the
            properties window. There is a property called CopyLocal which should be true.
            VS will then automatically put a copy of the dll in the project bin folder.


            --
            Ciaran O''Donnell
            try{ Life(); } catch (TooDifficultException) { throw Toys(); }



            "K Viltersten" wrote:
            I'm not sure. Where in reference should it be?
            The folder with my references only shows the
            packages/files i've chosen to use...
            >
            --
            Regards
            Konrad Viltersten
            ----------------------------------------
            May all spammers die an agonizing death;
            have no burial places; their souls be
            chased by demons in Gehenna from one room
            to another for all eternity and beyond.
            "Alhambra Eidos Desarrollo"
            <AlhambraEidosD esarrollo@discu ssions.microsof t.comskrev i meddelandet
            news:6FBF87C4-60D3-4EC8-98A5-62D5F45308EB@mi crosoft.com...
            Mister, has you Copy Local = true in references ??

            Thanks.
            >
            >
            >

            Comment

            • K Viltersten

              #7
              Re: How to resolve this FileNotFoundExc eption?!

              Select the Assembly in the references folder in the project and then open
              the
              properties window. There is a property called CopyLocal which should be
              true.
              VS will then automatically put a copy of the dll in the project bin
              folder.
              Oh, now i see. It does so already. The problem is that i then
              move the files by hand to another directory. That's the
              problem. I assumed that the compiler automagically baked
              in all the DLL's and EXE's needed into one and the same
              file that i could then run from anywhere. Stupid me...

              Thousand thanks to everybody.

              --
              Regards
              Konrad Viltersten
              ----------------------------------------
              May all spammers die an agonizing death;
              have no burial places; their souls be
              chased by demons in Gehenna from one room
              to another for all eternity and beyond.


              Comment

              Working...