This project has moved. For the latest updates, please go here.

WPF Toolkit - Cannot find resource when installing on test machine

Jan 3, 2013 at 1:08 PM

HI everyone,

I am trying to use the extended WPF toolkit in a project (office 2010 add-in) and when I run on my development machine everything works fine.    However when I use an installer project to install it on a test machine I get an exception when opening a WPF form that contains controls from the toolkit.  

The error appears to boil down to...

Cannot locate resource 'zoombox/themes/generic.xaml' 

I have included all pre-requisite dll's that i can see and even tried copying the files from my debug\bin over to the test machine but still no joy. 

Has anyone seen this before?

 

Regards

A

Jan 5, 2013 at 2:55 PM
Edited Jan 5, 2013 at 3:36 PM

Ive been working on this now on and off for a couple of days and still have not got to the bottom of why it is happening.  

When I install the VSTO addin on a test machine the WPF form that contains a DropDownButton fails to show up with the error mentioned in the post above.   If I remove the reference to the zoombox\themes\generic.xaml from the themes\generic.xaml file then the form shows but the dropdown buttons on the form do not.

This suggests to me that the zoombox\themes\generic.xaml file is required for the toolkit to work in the big scheme of things but it also suggests there is a problem within that file as the resource cannot be located when running through a hosted vsto app.  (I still have no idea why it is working on my dev machine fine)

I investigated the zoombox\themes\generic.xaml file and every now and then I am getting the error...

Missing key value on 'InputBindingCollection' object

...show up although i have checked and all the elements in the <Resources> collection have an x:Key value assigned.  

In addition I am seeing that the following setter doesnt seem to have a corresponding property <Setter Property="ViewFinderVisibility" Value="Collapsed" /> to set so I have remarked it out for now.

This problem is driving me mad now as I really need to get it sorted for next week.   I am using WPFToolkit Extended 1.8 and Visual Studio 2010 with an Office 2010 add-in as the host application.

Any help much appreciated 

Thanks

Andy

Jan 7, 2013 at 4:55 PM

Ok slightly different approach, ive now remarked out the link to the zoombox generic xaml file and the solution now installs and the form appears but all instances of my dropdownbuttons on the wpf form have disappeared.   I tried forcing visibility=visible on the controls in the form xaml but no luck.   

Any thoughts still appreciated.

 

Andy

Jan 7, 2013 at 8:15 PM

Do could you reproduce the issue with a sample app ?

By adding a DrowDownButton with some in a simple windows, I do not get any exception...

<Window x:Class="WpfApplication23.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:tk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
      <StackPanel>
         <tk:DropDownButton Content="Test" >
            <tk:DropDownButton.DropDownContent>
               <StackPanel>
                  <TextBlock Text="Test1"/>
                  <TextBlock Text="Test2"/>
               </StackPanel>
            </tk:DropDownButton.DropDownContent>
         </tk:DropDownButton>
      </StackPanel>
   </Grid>
</Window>

Jan 7, 2013 at 10:29 PM

Hi there,

It is not easy to reproduce the issue as the components are hosted within a pair of VSTO addins which are part of a single installer with a merge module.  Happy to do a remote session though if that would help.

Ive got to the point where the WPF form that the dropdownbutton is on will appear but the control (or any control within the referenced toolkit) does not appear.  Its as if it is collapsed.   And as soon as I try and invoke anything (i.e. a messagebox inside the wpftoolkit) or access the button (that is not visible) from code it hangs Word.

The primary VSTO addin project uses the components (datetimepicker) and that seems to be fine.   Ive not done anything different in terms of referencing so I have no idea what is going wrong.

 

Regards

Andy

Jan 19, 2013 at 10:02 AM

Finally found a solution to this issue after bringing in some expert help.

One of the projects uses reflection to scan any DLLs found in the project folder to see if there are compatible objects that can be loaded into the main project for use by the user.   However it looks like the folder being scanned was the parent of the application folder so it was picking up a second wpftoolkit dll from the release folder as well as the one from debug. 

So basically, the error was saying it couldnt decide which resource to resolve to as there were two available.

Relieved but now behind schedule with the project.   

Feb 13, 2014 at 9:47 AM
Can you write a more detailed explanation to how resolve this issue?

Thank You
Lorenzo