Unable to references images in a WPF application from a .Net 6 dll

Viewed 42

We are migrating our WPF app from .Net 4.7.2 to .Net 6. Most of our application is in WPF, but we have a project in development that will be in Asp.Net.

Our WPF projects have the net6.0-windows target framework. Our non-wpf specific projects have a net6.0 target framework.

We are referencing images like this:

pack://application:,,,/Project.Name;component/Path/Inside/Project/Image.svg

We noticed we have an issue, the images doesn't appear in our .Net 6 app. We noticed that IF we change the "non-WPF-specific" DLL to use also the net6.0-windows framework and set the UseWpf properties of their project to true, it work.

Unfortunately it is not acceptable for us, since we will have to use those project in the Asp.Net core application(in a docker container). I know we have the solution to extract the images in a dedicated project, but currently they are grouped by "package" according to their business object.

Is their a way to avoid to have to make those DLL windows specific or extract all the images and change their path(easily 700+ images to change, from a lot of different projects).

Note

0 Answers
Related