Include a Folder in ClickOnce Application

前端 未结 5 771
萌比男神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:13

    So Tom has explained how to add a file. You specifically say you would like to add a folder to your ClickOnce application once you publish it. Lets assume you have a folder sitting in the root of your solution named Dependencies which contains a folder Reports which contains all of your RPT files. Here is how you would make sure your deployed app contains all of the contents of the Dependencies folder:

    1. Right click your project in Visual Studio and select "unload project".

    2. Right click and select to edit the csproj file.

    3. Before the closing tag add this:



      %(RecursiveDir)%(Filename)%(Extension)
      false


    4. That will add everything from the Dependencies folder into the project. We are using the \**\* syntax at the end of the Include and %(RecursiveDir) to ensure the Reports folder will be present in the published version as well as the report files. Having set false you won't see the items cluttering up the solution explorer.

提交回复
热议问题