Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chain-referenced assemblies in WPF

today I'd like to know how do you configure your projects in C# WPF which references additional assemblies in a chain. By the "in a chain" I mean something like this:

  • we have application which refers to assembly Plugin
  • Plugin assembly refers Resources where resources used by Plugin are located, eg. images
  • main application does not refers to Resource in any way.

The following image illustrates what I've just said:
Chain-referenced assemblies

The problem is that Resources is not copied to the bin folder of the application, causing Plugin (Ctrl on the image) resources it requires finding failure.

Workaround

There are workarounds for it which are simply to include Resources to references of the main application or use a post-build step and manually copy required files in that step.

Conclusion

Concluding, I'd like to ask how do you deal with that problem. Are the any other solutions besides those I mentioned in workaround section? Am I missing something in the projects' configuration?

like image 450
SOReader Avatar asked Dec 03 '25 16:12

SOReader


1 Answers

Make sure that the output directory in the Plugin project properties is same as the output directory of your application. Otherwise you have to copy files yourself as you do.

Second option would be using embedded resources.

like image 68
kokoska69 Avatar answered Dec 06 '25 06:12

kokoska69



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!