Author Topic: WPF Resource Dictionary  (Read 1833 times)

0 Members and 1 Guest are viewing this topic.

jtoverka

  • Newt
  • Posts: 127
WPF Resource Dictionary
« on: August 31, 2021, 05:25:05 PM »
Hello All,

I have an issue that popped up when I was separating code into respective libraries. I have a vs project called BasicWPF. Inside is a StyleDictionary for WPF XAML. I reference that resource dictionary elsewhere in other projects. I have applications that run outside of AutoCAD that run just fine.

The issue is when I run a project inside AutoCAD an Error pops up. It's pretty clear, a FileNotFoundException on BasicWPF, which is triggered from the ResourceDictionary reference in XAML. Now this BasicWPF is indeed in the project directory. I have another application in the same directory that references that dll and it runs just fine outside of AutoCAD.

Has anyone experienced this issue?

jtoverka

  • Newt
  • Posts: 127
Re: WPF Resource Dictionary
« Reply #1 on: September 03, 2021, 06:47:56 AM »
Should have looked more closely. Solution here:
http://www.theswamp.org/index.php?topic=54708.msg592308#msg592308

helaman

  • Mosquito
  • Posts: 6
Re: WPF Resource Dictionary
« Reply #2 on: October 06, 2021, 12:56:39 AM »
Something similar happened to me.
You have to load the dll at the beginning of your command.
The dll has to be in the root folder.
Code - C#: [Select]
  1. Assembly.LoadFrom(System.IO.Path.Combine(System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "MaterialDesignThemes.Wpf.dll"));