VS2008.NET: Getting a referenced project's dependencies to copy to main project's bin folder

前端 未结 4 1288
离开以前
离开以前 2021-01-18 08:28

Let\'s assume I have a C# Winforms project, MainGUI.

It references another project in the same solution, ControlsLib.

ControlsLib references a third party co

相关标签:
4条回答
  • 2021-01-18 08:49

    You would need to add a link to the necessary files from the UI project (MainGUI) and set them to copy to the output folder from there. The inbuilt packaging tools do (IIRC) cascade these correctly, but for external tools I expect you'll need to do it manually.

    On my build server, I use a script that investigates references, and adds in all the descendent references just before it is built (by editing the csproj files as xml)... the code is not great, but it does the job.

    0 讨论(0)
  • 2021-01-18 08:54

    If you modify the main project properties (the executable one) on the tab Publish, option Application Files, then you will be able to tell VS to include all files that are not being copied.

    0 讨论(0)
  • 2021-01-18 08:55

    I have just solved this by adding the following post build event command line to the .csproj file for MainGUI (project properties -> build events)

    copy $(SolutionDir)ControlsLib\bin\$(ConfigurationName)\Infragistics2*.dll $(TargetDir)
    

    I hadn't realised doing that was so easy actually...

    0 讨论(0)
  • 2021-01-18 09:04

    I have had a similar problem using Gentle.NET (O/R Mapper). One of the DLLs refuses to copy. I've investigated for hours and have been unable to find a reason. All the other files are being copied, but THAT one is excluded for some odd reason. Gentle used three DLLs, Gentle.Common.DLL, Gentle.Framework.DLL and Gentle.SQLProvider.DLL. The last one never gets copied.

    In the end I simply made a script…

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