- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, I'm developing an adding for Revit and have several buttons with GUI I decided to create a new project to put all the resource dictionaries inside. When I compile the app the compiler is not throwing me any error and even the Visual Studio Designer is applying the styles correctly. But when I open Revit and try to run a button with GUI is throwing back a FileNotFoundException and says that can locate my styles .dll.
System.Windows.Markup.XamlParseException: ''Set property 'System.Windows.ResourceDictionary.Source' threw an exception.' Line number '17' and line position '18'.'
Inner Exception
FileNotFoundException: Could not load file or assembly 'Themes.SharedStyles, Culture=neutral' or one of its dependencies. The system cannot find the file specified.
This is the error, my 2 .dll are copied to addins directory.
This is how I importing the styles into the MainWindow.xaml File
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes.SharedStyles;component/ButtonStyles/TopBarButton.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Themes.SharedStyles;component/ButtonStyles/MainButton.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
And this is my file organization
Anyone have an idea what is happening I checked all my compilation configuration and everything seems to be fine.
I would appreciate I somebody could help me, thanks.
Solved! Go to Solution.