Referencing external DLL? VS2005 copies to bin directory

Discussion in 'ASP .Net' started by Chris Ashley, Sep 21, 2006.

  1. Chris  Ashley

    Chris Ashley Guest

    I've written a C++ Wrapper DLL which I need to add a reference to in my
    ASP.Net project. This in turn is dependent on the DLL it wraps which is
    in turn dependent on some other DLLs. When I reference the wrapper DLL
    VS2005 copies it to the 'bin' directory and I am unable to compile with
    the error 'the specified module could not be found'. It still has the
    same behaviour if I copy all the dependent DLLs to my bin directory,
    but this isn't a solution anyway because I need to maintain the
    directory structure and DLL locations on this machine (for source
    control reasons) and I don't want Visual Studio moving things around.

    I know my DLL is okay because I developed a quick tester windows app
    which referenced the DLL without 'copy local' - this worked fine.

    How can I fix this?
    Chris Ashley, Sep 21, 2006
    #1
    1. Advertising

  2. your bin folder is not the working dir of the app, so the default loading
    does not find it. you can copy the dll to windows\system32, to the .net
    framework bin, or change the working folder to a directory containing the
    dll before referencing the first time.

    note: the web site does not really use the bin folder, it is shadow copied
    to another dir in temp so the dlls will not be in use, and thus can be
    updated with new dll's

    -- bruce (sqlwork.com)

    "Chris Ashley" <> wrote in message
    news:...
    > I've written a C++ Wrapper DLL which I need to add a reference to in my
    > ASP.Net project. This in turn is dependent on the DLL it wraps which is
    > in turn dependent on some other DLLs. When I reference the wrapper DLL
    > VS2005 copies it to the 'bin' directory and I am unable to compile with
    > the error 'the specified module could not be found'. It still has the
    > same behaviour if I copy all the dependent DLLs to my bin directory,
    > but this isn't a solution anyway because I need to maintain the
    > directory structure and DLL locations on this machine (for source
    > control reasons) and I don't want Visual Studio moving things around.
    >
    > I know my DLL is okay because I developed a quick tester windows app
    > which referenced the DLL without 'copy local' - this worked fine.
    >
    > How can I fix this?
    >
    bruce barker \(sqlwork.com\), Sep 21, 2006
    #2
    1. Advertising

  3. Chris  Ashley

    Chris Ashley Guest

    Hi Bruce,

    Thanks for that. How do I change the working folder for an ASPNet site
    in VS2005?

    Thanks,

    Chris


    bruce barker (sqlwork.com) wrote:
    > your bin folder is not the working dir of the app, so the default loading
    > does not find it. you can copy the dll to windows\system32, to the .net
    > framework bin, or change the working folder to a directory containing the
    > dll before referencing the first time.
    >
    > note: the web site does not really use the bin folder, it is shadow copied
    > to another dir in temp so the dlls will not be in use, and thus can be
    > updated with new dll's
    >
    > -- bruce (sqlwork.com)
    >
    > "Chris Ashley" <> wrote in message
    > news:...
    > > I've written a C++ Wrapper DLL which I need to add a reference to in my
    > > ASP.Net project. This in turn is dependent on the DLL it wraps which is
    > > in turn dependent on some other DLLs. When I reference the wrapper DLL
    > > VS2005 copies it to the 'bin' directory and I am unable to compile with
    > > the error 'the specified module could not be found'. It still has the
    > > same behaviour if I copy all the dependent DLLs to my bin directory,
    > > but this isn't a solution anyway because I need to maintain the
    > > directory structure and DLL locations on this machine (for source
    > > control reasons) and I don't want Visual Studio moving things around.
    > >
    > > I know my DLL is okay because I developed a quick tester windows app
    > > which referenced the DLL without 'copy local' - this worked fine.
    > >
    > > How can I fix this?
    > >
    Chris Ashley, Oct 19, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J Gao
    Replies:
    0
    Views:
    1,207
    J Gao
    Jul 28, 2003
  2. Jon Ballinger
    Replies:
    2
    Views:
    327
    Jon Ballinger
    Oct 30, 2003
  3. Joo Park
    Replies:
    1
    Views:
    285
    bruce barker
    Feb 18, 2005
  4. TS
    Replies:
    4
    Views:
    833
    Steven Cheng[MSFT]
    Feb 1, 2006
  5. anne001
    Replies:
    1
    Views:
    428
Loading...

Share This Page