Visual Studio: How to “Copy to Output Directory” without copying the folder structure?

后端 未结 8 993
礼貌的吻别
礼貌的吻别 2020-12-04 08:43

I have a few dll files in \\lib folder of my project folder. In the property page of dll, I have selected \"Build Action\" as \"Content\" and \"Copy to Output Directory\" as

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-04 09:32

    I had the same problem with Visual Studio 2010 / C# Project.

    For assemblies (i. e. having the .NET interface) use folder "References" under your project in the Solution Explorer. Right click it, choose "Add existing item" and locate your .dll assembly.

    Common .dll files can be placed in a subfolder (as "\lib" was mentioned above) and in the properties select:

    • Build Action = "HelpFiles"
    • Copy To OutputDirectory = "If Newer"

    This worked for me exactly as desired - during build, the .DLLs are copied to the output directory without the "\lib" subfolder.

提交回复
热议问题