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

12 posts, 0 answers
  1. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 27 May Link to this post

    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.

     

  2. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 27 May in reply to Eugene Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 27 May in reply to Eugene Link to this post

    Though the password has no effect on what happens in the development of applications.
  5. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 30 May in reply to Eugene Link to this post

    Gentlemen, I need in your help about the abovementioned problem. Very!
  6. Bobby Ross
    Bobby Ross avatar
    18 posts
    Member since:
    Nov 2004

    Posted 01 Jun Link to this post

    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..

  7. Bobby Ross
    Bobby Ross avatar
    18 posts
    Member since:
    Nov 2004

    Posted 01 Jun in reply to Bobby Ross Link to this post

    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.
  8. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 02 Jun in reply to Bobby Ross Link to this post

    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.
  9. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 06 Jun Link to this post

    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.
  10. Eugene
    Eugene avatar
    83 posts
    Member since:
    Jan 2016

    Posted 07 Jun in reply to Evgenia Link to this post

    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.

  11. Evgenia
    Admin
    Evgenia avatar
    1407 posts

    Posted 10 Jun Link to this post

    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.
  12. Chris
    Chris avatar
    6 posts
    Member since:
    Feb 2016

    Posted 13 Jul in reply to Evgenia Link to this post

    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

  13. Chris
    Chris avatar
    6 posts
    Member since:
    Feb 2016

    Posted 13 Jul in reply to Chris Link to this post

    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

  14. Chris
    Chris avatar
    6 posts
    Member since:
    Feb 2016

    Posted 13 Jul in reply to Chris Link to this post

    Actually it was Evgenia's suggestion sorry :)
Back to Top
UI for WPF is Visual Studio 2017 Ready