'Visual Studio Pre-build action to embed external xml file

I'm on visual studio 2019 and developing a VSTO application using C#. I'm using WPF and MVVM by use of VSTOContrib library. The library uses naming convention to couple view (xml file) and viewmodel at runtime by searching the assembly.

The problem:

The view (xml file) is managed externally by non-developers in a separate folder. And this folder's path is unchangeable.

I've come to the conclusion the best course of action would be to embed the file at build time using pre-build actions however after hours of research I've been unable to find any information on the subject.

Has anyone done this before?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source