none
MSBuild does not find referenced DLL RRS feed

  • Question

  • I've seen a few posts about this but no useful solutions.

    I have two VS solutions. Solution A produces a DLL, and B references that DLL. Both build without issue on my workstation.

    On our build server, A builds fine, but the build for B fails because it can't find the DLL created by A.

    This make some sense because the relative path is not the same on the build server.

    What is the fix for this?

    Tom


    • Edited by tslickers Saturday, May 4, 2019 2:24 PM
    Saturday, May 4, 2019 2:22 PM

All replies

  • Hi tslickers,

    Welcome to MSDN forum.

    According to your description, since relative path will go relative to each project file, I'm afraid that there is not an appropriate method to set the same relative path when you build different solutions.

    When the B refers A on the workstation, the reference path is absolute path, please select the dll to check it in properties window.

      

    So if you want the dll which is from A to go to B build path, you have to specify an absolute path.

    msbuild myproject.proj /p:OutputPath=c:\mydir

    Also you could edit msbuild project(.proj file) to move it to one path.

    ##Move Task

    <ItemGroup>
         <FilesToMove Include="..\..\..\..\..\ $(OutServiceDirectory)\%(BuildConfig.AppServer)\*.dll"/>
    </ItemGroup>
    
    <Target Name="CombineOutputFile" AfterTargets="Build">
         <Move SourceFiles="@(FilesToMove)" DestinationFolder="${DestinationFolder}" />
    </Target>

    ##Extends the behavior of the normal build to create the proper outputs, please refer to more here.

    <Target Name="Build"
        DependsOnTargets="$(BuildDependsOn)"
        Outputs="@(AllOutputs->'%(FullPath)')">
    
    <CreateItem Include="$(OutputPath)\**\*">
      <Output ItemName="AllOutputs" TaskParameter="Include"/>
    </CreateItem>

    Hope these can help you. Any feedback will be expected.

    Best Regards,

    Dylan



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com

    Sunday, May 5, 2019 9:49 AM
  • @Tom,

    What about this issue in your side? Would you please share us the latest information?

    Best Regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 20, 2019 3:15 AM
    Moderator