Add External DLL Reference To WIX

Smit Rathod 100 Reputation points
2023-02-28T05:40:18.1+00:00

I am having 4 projects.

  • Project1 (Depends on Project2 & Project4)
  • Project2 (Depends on Project4)
  • Project3 (Shim Project)
  • Project4

I have Project5.dll which I have to add as a reference of Project2.

Locally, It's working fine. But whenever I am trying to build/generate Project1.msi & Installing it, It's saying that 'Couldn't load file or assembly Project5.dll'.

I have tried to add Project5.dll manually at the installation folder. But it doesn't resolve the error I am getting.

I have also added the below line to Product.wxs. It's placing the Project5.dll at installation folder. But I am getting same error.

<File Id="Project5_dll" Name="Project5.dll" Source="$(var.Source)" />

I have marked Project5.dll as Copy Local = True. But still I have no success.

Any way to identify that Project5.dll is reference of Project2 ?

How to add this reference?

Developer technologies ASP.NET Other
Developer technologies C#
0 comments No comments
{count} votes

Accepted answer
  1. Alan Farias 755 Reputation points
    2023-02-28T16:59:31.2466667+00:00

    It seems that the issue is related to the deployment of the Project5.dll file. Here are some suggestions that may help:

    1. Make sure that the Project5.dll file is included in the setup project as a file that needs to be installed along with the application.
    2. Check if the Project5.dll file is being copied to the output folder of Project2 during the build process. You can do this by checking the properties of the reference to Project5.dll in Project2. Make sure that the "Copy Local" property is set to true.
    3. If Project2 is being built as a class library, try adding the Project5.dll file as an embedded resource in the class library project. This will include the DLL in the compiled output of Project2, which can then be used by Project1.
    4. You can also try to use a tool like Fusion Log Viewer to help diagnose the issue. Fusion Log Viewer can show you the locations where the .NET runtime is looking for the Project5.dll file, and can help you determine why it is not being found.
    5. To identify that Project5.dll is a reference of Project2, you can check the references of Project2 in Visual Studio. If Project5.dll is listed as a reference, it means that it is being used by Project2.

    I hope one of these suggestions helps you resolve the issue with the deployment of Project5.dll.


    Please, if this answer is helpful, click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please let me know.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.