Including xml files when deploying WPF application

I have a WPF application with 3 projects to represent a 3-layer architecture. One project is set as the main project. I have some XML files in one of the non-main project. These XML files are accessed by functions defined in classes of that project.

When I try to publish the application using VS2010 ClickOnce, the XML files are not included in the installation file even after marking the files' Build Action to Content and Copy-to-OutputDirectory as Copy Always. When running the installed application, the application reports that the files are not found. I can see an Application_Files folder in the installation folder generated by ClickOnce, but it does not contain the XML files.

So, my question is how can I include the XML files in the installation folders and also get their location URL while running the application.

Thanks, Навин

Обновление 1: Структура прикладного решения состоит из трех проектов, скажем, P1, P2 и P3. P3 - основной стартап-проект. P1 и P2 - это проекты библиотеки классов. Файлы XML добавляются в проект P2. Файлы помечены как Build Action -> Content и Copy -> Copy Always. Однако эти файлы не копируются ClickOnce в папку данных приложения при публикации приложения.

8
задан naveen 5 April 2011 в 08:22
поделиться