Dependencies of references not copied to output directory

后端 未结 3 1197
长情又很酷
长情又很酷 2021-01-03 23:37

I have a CommonUtils lib I have built into a dll which I file reference from several of my projects. CommonUtils depends on log4net.dll which was set as a file reference and

相关标签:
3条回答
  • 2021-01-04 00:09

    This is by design. You need to think about the implications that automatic inheritance of references would cause. While you can logically see what the references should be, there is no such delineation to the compiler. You could, theoretically, end up reproducing the Framework and a good part of your OS if it walked the entire dependency tree.

    It definitely is a pain, and I agree with and understand your frustration, but I assume that Microsoft was not able to find a logical way to do this otherwise.

    0 讨论(0)
  • 2021-01-04 00:15

    When I've had a similar situation in the past, I received a compiler warning within Visual Studio telling me that I needed to add a reference to the dependent library.

    Are you receiving such a warning when you compile? If so, follow the advice it gives and you should find Log4net copied to your output directory.

    0 讨论(0)
  • 2021-01-04 00:36

    I believe if you do not add log4net as a reference in your project it will not get copied.

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