locked
Libraries handling .NET solutions RRS feed

  • Question

  • User-83242061 posted

    Hello,

    First of all, I have to say that I'm new in .NET development, that's why this question may be a little bit silly but I need some guidance. I recently started working with a development team. When this project was shared with me, it had no libraries inside the project and I had to add them all manually from a local folder I was given. The references were there but they all were marked with warnings because VS was unable to find the files. So I was wondering if there is a way to make relative paths to references and keep the DLL files inside a project folder to avoid adding them manually.

    Thanks in advance!

    Friday, January 22, 2021 3:25 PM

Answers

  • User-1545767719 posted

    Try putting the required assemblies (i.e., .dll files) in the bin folder of the project?

    See following Microsoft document for your reference:

    Shared Code Folders in ASP.NET Web Sites

    ASP.net assembly loading from GAC or Bin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 22, 2021 9:41 PM
  • User1535942433 posted

    Hi apgallon,

    Accroding to your description,I'm guessing that you want  to make relative path to references.

    If you are visual studio 2017,it is automatic. So just Add Reference as usually.

    Note that in Reference Properties absolute path is shown, but in .vbproj/.csproj relative is used.

    Just like this:

    <Reference Include="NETnetworkmanager">
          <HintPath>..\..\libs\NETnetworkmanager.dll</HintPath>
          <EmbedInteropTypes>True</EmbedInteropTypes>
    </Reference>
    

    If it's not automatic.You could do like this:

    1.Add the reference in Visual Studio GUI by right-clicking the project in Solution Explorer and selecting Add Reference...

    2.Find the *.csproj where this reference exist and open it in a text editor

    3.Edit the < HintPath > to be equal to

    <HintPath>..\..\myReferences\myDLL.dll</HintPath>

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 25, 2021 6:20 AM
  • User753101303 posted

    Hi,

    They are extenal or internal librairies? This local folder is updated from which source? See maybe with the team to better understand their suggested approach.

    Another option could be to use https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds which allows to share a DLL repository (including having multiple version for each DLL). Then  packages are added thhrough nuget and any machine having access to that source can then fetch the needed DLLs automatically.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 25, 2021 8:47 AM

All replies

  • User-1545767719 posted

    Try putting the required assemblies (i.e., .dll files) in the bin folder of the project?

    See following Microsoft document for your reference:

    Shared Code Folders in ASP.NET Web Sites

    ASP.net assembly loading from GAC or Bin

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 22, 2021 9:41 PM
  • User1535942433 posted

    Hi apgallon,

    Accroding to your description,I'm guessing that you want  to make relative path to references.

    If you are visual studio 2017,it is automatic. So just Add Reference as usually.

    Note that in Reference Properties absolute path is shown, but in .vbproj/.csproj relative is used.

    Just like this:

    <Reference Include="NETnetworkmanager">
          <HintPath>..\..\libs\NETnetworkmanager.dll</HintPath>
          <EmbedInteropTypes>True</EmbedInteropTypes>
    </Reference>
    

    If it's not automatic.You could do like this:

    1.Add the reference in Visual Studio GUI by right-clicking the project in Solution Explorer and selecting Add Reference...

    2.Find the *.csproj where this reference exist and open it in a text editor

    3.Edit the < HintPath > to be equal to

    <HintPath>..\..\myReferences\myDLL.dll</HintPath>

    Best regards,

    Yijing Sun

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 25, 2021 6:20 AM
  • User753101303 posted

    Hi,

    They are extenal or internal librairies? This local folder is updated from which source? See maybe with the team to better understand their suggested approach.

    Another option could be to use https://docs.microsoft.com/en-us/nuget/hosting-packages/local-feeds which allows to share a DLL repository (including having multiple version for each DLL). Then  packages are added thhrough nuget and any machine having access to that source can then fetch the needed DLLs automatically.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, January 25, 2021 8:47 AM