DLL reference not copying into project bin

后端 未结 3 1071
滥情空心
滥情空心 2020-12-13 12:54

Project A references Project B, and Project B references an external DDL (restored using NuGet)

相关标签:
3条回答
  • 2020-12-13 13:08

    When I ran into this problem it was because I changed a project's name, but did not change the assembly name - it was identical to the assembly name of another project in the solution.

    0 讨论(0)
  • 2020-12-13 13:21

    I've added some dummy (unused) code on Project B, making reference to the DLL needed.

    Thus, the compiler will guess that it must copy the DLL into project A output.

    0 讨论(0)
  • 2020-12-13 13:30

    The options that I found were to:

    • Add a reference to PostSharp in Project A.
    • Add dummy code in Project B so that the compiler would detect that the reference is being used.
    • Add a build event to force copy the DLL.

    I don't like any of the above solutions. They are hacks in my opinion and will only make for a more unmaintainable solution in the long run.

    I have fixed the problem by using a common output directory. This seems to be a recommended solution by many. I have also experienced much faster build times. See this Stackoverflow post.

    0 讨论(0)
提交回复
热议问题