How to include extra files in Visual Studio Publish for WPF Application?

James Baker 1 Reputation point
2021-11-18T08:58:02.333+00:00

I have my .net 5 WPF application setup to publish with these settings below.

150478-image.png

My application is a PRISM (MVVM framework) application and uses a modular structure. The module projects are not directly referenced by the main application project. Instead they are discovered at runtime by prism which extracts any container registrations and adds them to it's container. These module projects are set to be built into the same application directory which is where PRISM discovers them. So when it comes to running the application it all works as expected.

When it comes to publishing though, these files are ignored and so the application doesn't work from the publish folder. So how do you include any extra files like this in the publish process?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,703 questions
{count} votes