Using a .dll

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

    #1

    Using a .dll

    I'm coming from a Java background, and exploring C#. An acquaintance
    gave me a .dll that I plan on using in a couple of projects. His
    directions involved putting a copy of the .dll in the folder where my
    project is and adding a reference to it. I've gotten everything to
    work just fine, but I've got a few general questions regarding the use
    of .dll's in this fashion. Unfortunately, my acquaintance has gone on
    vacation, so I hope that I might be able to get my questions answered
    here.

    Just to be clear, the questions are NOT about any specific .dll, but
    rather using .dll's in any .NET program.

    Question 1: If I create a program using a .dll and want to use it on
    a different machine, I assume that I need to send a copy of the .dll
    as well. Am I correct?

    Question 2: If the answer to #1 is yes, does the .dll need to be in
    the same place relative to the .exe file that was when I created it?
    If so, then should I be putting it in the Release sub-folder and
    referencing it there?

    Question 3: I'm accustomed to .dll's being stored in the Windows
    folder. Could I put a copy of a.dll that I'm using there instead of
    in each project folder, and reference to it there? If so, should I?

    Question 4: Some of the things that I may be doing will be done in a
    networked environment. The source code will be on the network. How
    might that affect the answers to any of my other questions?

    Thanks in advance!

  • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

    #2
    Re: Using a .dll

    TomC wrote:
    Question 1: If I create a program using a .dll and want to use it on
    a different machine, I assume that I need to send a copy of the .dll
    as well. Am I correct?
    Yes.
    Question 2: If the answer to #1 is yes, does the .dll need to be in
    the same place relative to the .exe file that was when I created it?
    If so, then should I be putting it in the Release sub-folder and
    referencing it there?
    Put the dll file in the same dir as your exe file.

    That is the simplest.
    Question 3: I'm accustomed to .dll's being stored in the Windows
    folder. Could I put a copy of a.dll that I'm using there instead of
    in each project folder, and reference to it there? If so, should I?
    Not in the windows folder.

    You could put it in GAC to achieve the same.
    Question 4: Some of the things that I may be doing will be done in a
    networked environment. The source code will be on the network. How
    might that affect the answers to any of my other questions?
    Where the source code is should not effect anything.

    Arne

    Comment

    • TomC

      #3
      Re: Using a .dll

      Thanks for the information. I do need to clarify one of your answers.
      Question 2: If the answer to #1 is yes, does the .dll need to be in
      the same place relative to the .exe file that was when I created it?
      If so, then should I be putting it in the Release sub-folder and
      referencing it there?
      >
      Put the dll file in the same dir as your exe file.
      >
      That is the simplest.
      So do you mean that when I'm building the app, the .dll should be in
      the bin/Release folder where the .exe will end up? Or do you mean
      that it doesn't matter where it is when I build it, but when I
      distribute it, put the .dll in the same folder as the .exe?

      Comment

      • =?ISO-8859-1?Q?Arne_Vajh=F8j?=

        #4
        Re: Using a .dll

        TomC wrote:
        >>Question 2: If the answer to #1 is yes, does the .dll need to be in
        >>the same place relative to the .exe file that was when I created it?
        >>If so, then should I be putting it in the Release sub-folder and
        >>referencing it there?
        >Put the dll file in the same dir as your exe file.
        >>
        >That is the simplest.
        So do you mean that when I'm building the app, the .dll should be in
        the bin/Release folder where the .exe will end up? Or do you mean
        that it doesn't matter where it is when I build it, but when I
        distribute it, put the .dll in the same folder as the .exe?
        The last.

        Arne

        Comment

        • TomC

          #5
          Re: Using a .dll

          On Jul 22, 8:46 am, Arne Vajhøj <a...@vajhoej.d kwrote:
          TomC wrote:
          >Question 2: If the answer to #1 is yes, does the .dll need to be in
          >the same place relative to the .exe file that was when I created it?
          >If so, then should I be putting it in the Release sub-folder and
          >referencing it there?
          Put the dll file in the same dir as your exe file.
          >
          That is the simplest.
          So do you mean that when I'm building the app, the .dll should be in
          the bin/Release folder where the .exe will end up? Or do you mean
          that it doesn't matter where it is when I build it, but when I
          distribute it, put the .dll in the same folder as the .exe?
          >
          The last.
          >
          Arne
          Thank you for your help.

          Comment

          • =?Utf-8?B?TW9kZWxCdWlsZGVy?=

            #6
            Re: Using a .dll

            You should look at creating a setup project in your solution. They are
            fairly straight forward to create and will take care of dependencies with
            distribution.

            "TomC" wrote:
            Thanks for the information. I do need to clarify one of your answers.
            >
            Question 2: If the answer to #1 is yes, does the .dll need to be in
            the same place relative to the .exe file that was when I created it?
            If so, then should I be putting it in the Release sub-folder and
            referencing it there?
            Put the dll file in the same dir as your exe file.

            That is the simplest.
            So do you mean that when I'm building the app, the .dll should be in
            the bin/Release folder where the .exe will end up? Or do you mean
            that it doesn't matter where it is when I build it, but when I
            distribute it, put the .dll in the same folder as the .exe?
            >
            >

            Comment

            • TomC

              #7
              Re: Using a .dll

              On Jul 22, 11:18 am, ModelBuilder
              <ModelBuil...@d iscussions.micr osoft.comwrote:
              You should look at creating a setup project in your solution. They are
              fairly straight forward to create and will take care of dependencies with
              distribution.
              >
              "TomC" wrote:
              Thanks for the information. I do need to clarify one of your answers.
              >
              Question 2: If the answer to #1 is yes, does the .dll need to be in
              the same place relative to the .exe file that was when I created it?
              If so, then should I be putting it in the Release sub-folder and
              referencing it there?
              >
              Put the dll file in the same dir as your exe file.
              >
              That is the simplest.
              So do you mean that when I'm building the app, the .dll should be in
              the bin/Release folder where the .exe will end up? Or do you mean
              that it doesn't matter where it is when I build it, but when I
              distribute it, put the .dll in the same folder as the .exe?
              By setup project, I assume that you mean an installation routine -
              often called setup.exe. I'm new enough to Visual Studio, I didn't
              know such a feature was available. Thanks!

              Comment

              • =?Utf-8?B?TW9kZWxCdWlsZGVy?=

                #8
                Re: Using a .dll

                Yes, as long as you are not using an "express" version, then you can add a
                new setup project to your solution. It will create at least a setup.exe and
                an install.msi file.

                "TomC" wrote:
                On Jul 22, 11:18 am, ModelBuilder
                <ModelBuil...@d iscussions.micr osoft.comwrote:
                You should look at creating a setup project in your solution. They are
                fairly straight forward to create and will take care of dependencies with
                distribution.

                "TomC" wrote:
                Thanks for the information. I do need to clarify one of your answers.
                Question 2: If the answer to #1 is yes, does the .dll need to be in
                the same place relative to the .exe file that was when I created it?
                If so, then should I be putting it in the Release sub-folder and
                referencing it there?
                Put the dll file in the same dir as your exe file.
                That is the simplest.
                So do you mean that when I'm building the app, the .dll should be in
                the bin/Release folder where the .exe will end up? Or do you mean
                that it doesn't matter where it is when I build it, but when I
                distribute it, put the .dll in the same folder as the .exe?
                >
                By setup project, I assume that you mean an installation routine -
                often called setup.exe. I'm new enough to Visual Studio, I didn't
                know such a feature was available. Thanks!
                >
                >

                Comment

                • TomC

                  #9
                  Re: Using a .dll

                  On Jul 22, 7:38 pm, ModelBuilder
                  <ModelBuil...@d iscussions.micr osoft.comwrote:
                  Yes, as long as you are not using an "express" version, then you can add a
                  new setup project to your solution. It will create at least a setup.exe and
                  an install.msi file.
                  >
                  "TomC" wrote:
                  On Jul 22, 11:18 am, ModelBuilder
                  <ModelBuil...@d iscussions.micr osoft.comwrote:
                  You should look at creating a setup project in your solution. They are
                  fairly straight forward to create and will take care of dependencies with
                  distribution.
                  >
                  "TomC" wrote:
                  Thanks for the information. I do need to clarify one of your answers.
                  >
                  Question 2: If the answer to #1 is yes, does the .dll need to be in
                  the same place relative to the .exe file that was when I created it?
                  If so, then should I be putting it in the Release sub-folder and
                  referencing it there?
                  >
                  Put the dll file in the same dir as your exe file.
                  >
                  That is the simplest.
                  So do you mean that when I'm building the app, the .dll should be in
                  the bin/Release folder where the .exe will end up? Or do you mean
                  that it doesn't matter where it is when I build it, but when I
                  distribute it, put the .dll in the same folder as the .exe?
                  >
                  By setup project, I assume that you mean an installation routine -
                  often called setup.exe. I'm new enough to Visual Studio, I didn't
                  know such a feature was available. Thanks!
                  Ah, that explains things. I am using the express version.

                  Comment

                  Working...