This is a migrated thread and some comments may be shown as answers.

Cannot locate resource 'themes\genericvista.xaml' error has place in design time.

12 Answers 1862 Views
Window
This is a migrated thread and some comments may be shown as answers.
Eugene
Top achievements
Rank 1
Eugene asked on 27 May 2016, 07:00 AM

I write C# WPF MVVM Prism 6 multimodule application in MS VS 2015. In my application I use your Telerik for WPF library that was updated in May 2016. In one of Prism modules I try to change one of the views from PrismUserControl(WPF) to telerik:RadWindow (as you have written in your instruction on: http://docs.telerik.com/devtools/wpf/controls/radwindow/how-to/use-radwindow-as-user-control). But when I create RadWindow according to abovementioned instruction then the following error has place: "XamlObjectWriterException: Setting of "System.Windows.ResourceDictionary.Source" property throws an exception".

StackTrace
 
   in MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   in MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
   in System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
   in System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
   in System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
   in System.Xaml.XamlObjectWriter.WriteEndMember()
   in System.Xaml.XamlWriter.WriteNode(XamlReader reader)
   in System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   in System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
   in System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
   in System.Windows.SystemResources.ResourceDictionaries.LoadGenericDictionary(Boolean isTraceEnabled)
   in System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
   in System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
   in System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
   in System.Windows.FrameworkElement.UpdateThemeStyleProperty()
   in System.Windows.FrameworkElement.OnInitialized(EventArgs e)
   in Telerik.Windows.Controls.RadWindow.OnInitialized(EventArgs e)
   in System.Windows.FrameworkElement.TryFireInitialized()
   in System.Windows.FrameworkElement.EndInit()
 
InnerException Cannot locate resource 'themes\genericvista.xaml'
   IOException: Cannot locate resource 'themes\genericvista.xaml'
 
   StackTrace
 
   in MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
   in System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
   in System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
   in System.IO.Packaging.PackWebResponse.GetResponseStream()
   in System.IO.Packaging.PackWebResponse.get_ContentType()
   in MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
   in MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
   in System.Windows.ResourceDictionary.set_Source(Uri value)
   in System.Windows.Baml2006.WpfSharedBamlSchemaContext.<>c.<Create_BamlProperty_ResourceDictionary_Source>b__342_0(Object target, Object value)
   in System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
   in MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
   in MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
.InnerException: No

Moreover. If I add in XAML, for example, telerik:RadButton or telerik:RadTreView then (in design-time)  "Cannot locate resource 'themes\genericvista.xaml' error occurs.

Below I dusplay contents of App.XAML file from Shell project of my application solution:

<Application x:Class="FlowmeterConfigurator.App"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             xmlns:local="clr-namespace:FlowmeterConfigurator"
             xmlns:views="clr-namespace:FlowmeterConfigurator.Views">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/System.Windows.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
                <ResourceDictionary Source="/Telerik.Windows.Themes.Office2013;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
            </ResourceDictionary.MergedDictionaries>
            <Style TargetType="views:Shell" BasedOn="{StaticResource RadWindowStyle}" />
        </ResourceDictionary>
    </Application.Resources>
</Application>

What the reason of "Cannot locate resource 'themes\genericvista.xaml' error ? How to eliminate it? Please help.

 

12 Answers, 1 is accepted

Sort by
0
Eugene
Top achievements
Rank 1
answered on 27 May 2016, 07:08 AM
Here I will add a little: When I updated telerik software this month I login not with my login but with corporate login which is different from mine.
0
Eugene
Top achievements
Rank 1
answered on 27 May 2016, 07:12 AM
Though the password has no effect on what happens in the development of applications.
0
Eugene
Top achievements
Rank 1
answered on 30 May 2016, 05:15 AM
Gentlemen, I need in your help about the abovementioned problem. Very!
0
Bobby Ross
Top achievements
Rank 1
answered on 01 Jun 2016, 05:02 PM

It appears that I am having the same issue with the latest build just updated today "Cannot locate resource 'themes/genericvista.xaml'" displaying in the error list.  The window cannot be opened in the designer as well and shows the stack trace related to the error.

I have many controls on my form such as docking, expanders, etc..

0
Bobby Ross
Top achievements
Rank 1
answered on 01 Jun 2016, 05:03 PM
As a note I meant that I just updated to the latest version today, the project does still build and am able to run, just no designer and annoying error.
0
Eugene
Top achievements
Rank 1
answered on 02 Jun 2016, 01:26 PM
So, you advice to update my telerik library? (I use lisensed DevCraft Complete.) But I can't update it now because I updated it at the beginning of May, 2016. Updates on DevCraft Complete are sent quarterly only. That is, it turns out that I can't fix 'themes\genericvista.xaml' error now? Its a pitty.
-1
Evgenia
Telerik team
answered on 06 Jun 2016, 02:24 PM
Hi Eugene,

I'm sorry to hear that you are facing hard times struggling with this issue. To be honest it looks like a version mismatch between the dlls is causing the problems on your side. 

Can you be more specific whether the error occurs in design time only? Does it build and work in runtime? What is the VisualStudio version do you test with? Can you reproduce it with other version? What version have you tried to upgrade from?

It will be of great help if you can tell us whether your current project was using XAML binaries or NoXAML binaries vefore the upgrade.

May I ask you to do the following:
-  Make sure you have referenced all the assemblies and they are with the same version.
 - Close all instances of Visual Studio
- Then delete the Bin and obj folders of the project manually, Clean and Rebuild it.

Check if this solves your issues. If not:
- Close all instances of Visual Studio
 - Clean the GAC (global assembly cache) and see if this helps

If the issue still occurs the following suggestion might seem a time-consuming and unwanted at first but trust me it's the best you can do to overcome the design time issues in such case:
Completely uninstall Telerik controls and reinstall them again. Clean/rebuild your project and everything should work.

I hope this information helps.

Regards,
Evgenia
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Eugene
Top achievements
Rank 1
answered on 07 Jun 2016, 02:00 PM

Hi, here I answer on your questions:

1) Can you be more specific whether the error occurs in design time only?  Yes, the error occures in design-time only.
2) Does it build and work in runtime? Yes, the application is built and works at runtime.

3) What is the VisualStudio version do you test with?  I use MS VS 2015 Profesional. OS is Windows 10.

4) Can you reproduce it with other version? What version have you tried to upgrade from? I've tryed not reproduce this error on other versions of MS VS and Windows.

0
Evgenia
Telerik team
answered on 10 Jun 2016, 08:34 AM
Hello Eugene and Bobby,

Can you please try a few more things for us? This will make it easier for us to try to reproduce the unwanted behavior:
1. Did you manually upgraded the binaries (by replacing all your references in the project) or you used the Visual Studio Extensions Upgrade Wizard?
2. Can you try and see whether there is any assembly version mismatch in your project after the upgrade -- use the Visual Studio Properties window to see if all your assemblies version is equal. 
3. One more thing to mention here -- 'themes/genericvista.xaml" is required by our StyleManager only and not our implicit styles mechanism. Can you clarify whether all your updated binaries are NoXAML? For the purpose open your project in Windows Explorer. On each Telerik assembly open context menu (right-click on it) and go to Details tab as shown on the attached image. The description will contain (NoXaml) suffix if the assembly is NoXaml.

Thanks in advance for all additional information you can provide.

P.S. Unfortunately for the moment we can't suggest you a better solution/workaround for the design time issue other than the ones I already provided in my previous post. We apologize for the inconvenience caused.

Regards,
Evgenia
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Chris
Top achievements
Rank 1
answered on 13 Jul 2016, 08:26 PM

Hello,

Eugene's suggestion to verify DLL versions, delete the bin and obj folders and perform a clean and rebuild worked for me.

I too am developing a C# WPF MVVM Prism6 multi module application using VS 2015 Professional.  I am creating an app much like the Telerik "Outlook-inspired" application.  I am using the latest version of the components 2016.2.613.45.  (I use a RadRibbonWindow along with a RadRibbonView complete with QuickAccessToolbar and BackStage.  It probably doesn't matter but I am using Unity for dependency injection.  Anyway I had this exact issue - the same error message and stack trace.  The issue appeared at design-time only, it ran successfully.

From Eugene:

 May I ask you to do the following:
-  Make sure you have referenced all the assemblies and they are with the same version.
 - Close all instances of Visual Studio
- Then delete the Bin and obj folders of the project manually, Clean and Rebuild it.

Hope this helps someone else.

Thanks,

Chris

0
Chris
Top achievements
Rank 1
answered on 13 Jul 2016, 08:28 PM

One thing I forgot to mention.  When you delete the bin folders keep in mind you will have to restore your NuGet packages (Prism, etc...)

Thanks,

Chris

0
Chris
Top achievements
Rank 1
answered on 13 Jul 2016, 08:38 PM
Actually it was Evgenia's suggestion sorry :)
Tags
Window
Asked by
Eugene
Top achievements
Rank 1
Answers by
Eugene
Top achievements
Rank 1
Bobby Ross
Top achievements
Rank 1
Evgenia
Telerik team
Chris
Top achievements
Rank 1
Share this question
or