Include a Folder in ClickOnce Application

前端 未结 5 770
萌比男神i
萌比男神i 2021-02-04 08:11

I\'ve created a Windows C# project and made it as ClickOnce Application(Publish feature in Project properties) for Installation. I want to Include a folder<

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-04 09:06

    Let's say that we have two projects: main - ProjectA and some other ProjectB referencing to ProjectA. In ProjectB we have a folder FolderB with some files that should be included in publish (pdf, rpt, etc.) of ProjectA.

    Once we build ProjectA there will be all referenced files and folders in bin directory. But when we publish solution using ClickOnce tool, folders from referenced ProjectB won't be included in the installer and you won't see them in Application Files window in project publish settings.

    The solution for this is to create a new folder called FolderB in ProjectA and add existing items form FolderB in ProjectB to this new folder in ProjectA using Add As Link option. Then all files, including files linked to ProjectB folders, will be included in publish.

提交回复
热议问题