Cannot compile result from Theme Editor (.NET 8, VS 2022)

I created a new theme with Theme Editor and am trying to compile the .NET 8 version in Visual Studio 2022 (actual version). Unfortunately, I am getting errors. According to https://www.syncfusion.com/forums/180282/theme-studio-generated-code-errors, I changed the version in global.json to 8.0.400. As it has no effect, I removed referenced assemblies and add the ones from C:\Program Files (x86)\Syncfusion\Essential Studio\WPF\27.1.48\precompiledassemblies\net8.0. 

I am still getting errors for a lot of XAML files: 

Error (active) MC3074 The tag 'ResourceDictionaryProvider' does not exist in XML namespace 'clr-namespace:Syncfusion.SfSkinManager;assembly=Syncfusion.SfSkinManager.WPF'.  

What should I do to get rid of the errors?


6 Replies

SN Sudharsan Narayanan Syncfusion Team October 11, 2024 01:34 PM UTC

Hi Slavek,

We have checked the reported query from our end. We are able to replicate the issue in the Net80 project. So, as we suggested to you in the 180282 forum, please refer to the assembly's path in the project as shown in the video below.

Please refer to the video below. If you still face the issue, please provide a replication video and sample to us. It will be helpful to prompt the solution earlier.


Regards,
Sudharsan


Attachment: ThemeEditorIssue_e94fba9a.zip


SL Slávek October 11, 2024 09:37 PM UTC

Hi  Sudharsan, 


The change in the assembly's path helped me move on. However, I am struggling to use the result. 


I register the theme in App.xaml.cs, it seems to be working fine.


public partial class App : Application
{
    public static LanguageManager LanguageManager { get; private set; } = new();
    protected override void OnStartup(StartupEventArgs e)
    {
        base.OnStartup(e);
        // Vložíme LanguageManager do Resources, aby byl přístupný i v XAML:
        Application.Current.Resources["LanguageManager"] = LanguageManager;


        string styleName = "CapricornProFluentLight";
        SkinHelper? styleInstance = null;
        var skinHelpterStr = "Syncfusion.Themes." + styleName + ".WPF." + styleName + "SkinHelper, Syncfusion.Themes." + styleName + ".WPF";
        Type? skinHelpterType = Type.GetType(skinHelpterStr);
        if (skinHelpterType != null)
            styleInstance = Activator.CreateInstance(skinHelpterType) as SkinHelper;
        if (styleInstance != null)
        {
            SfSkinManager.RegisterTheme(styleName, styleInstance);
        }
    }
}

The problem is when trying to set the theme in RibbonWindow:


        private void RibbonWindow_Initialized(object sender, EventArgs e)

        {
            SfSkinManager.SetTheme(this, new Theme("CapricornProFluentLight;FluentLight"));
        }

The core raises an exception: 


System.Windows.Markup.XamlParseException
  HResult=0x80131501
  Message=Entering value in System.Windows.Markup.StaticResourceHolder raised an exception.
  Source=PresentationFramework
  StackTrace:
   at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
   at System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
   at System.Windows.ResourceDictionary.get_Item(Object key)
   at Syncfusion.SfSkinManager.SfSkinManager.ApplyWindowStyle(Window window, String style, Theme themeinfo)
   at Syncfusion.SfSkinManager.SfSkinManager.ChangeVisualStyle(FrameworkElement felement, String visualstyle, Theme themeinfo)
   at Syncfusion.SfSkinManager.SfSkinManager.OnThemeChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at Syncfusion.Windows.Tools.Controls.RibbonWindow.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
   at Syncfusion.SfSkinManager.SfSkinManager.SetTheme(DependencyObject obj, Theme value)
   at DomneaSidekick.MainWindow.RibbonWindow_Initialized(Object sender, EventArgs e) in D:\Capricorn Pro\Projects\Domnea Sidekick\MainWindow.xaml.cs:line 135

  This exception was originally thrown at this call stack:
    [External Code]

Inner Exception 1:
Exception: Cannot find a resource named CapricornProCapricornProFluentLight.BorderThickness1. Resource names are case sensitive.

Attachment: CapricornProFluentLight_d08ea4a.zip


SN Sudharsan Narayanan Syncfusion Team October 14, 2024 03:26 PM UTC

Hi Slavek,

We have confirmed the reported scenario is a defect and logged a report for the reported scenario, “Exception occurs thrown in the custom theme”. We will fix this issue and include it in our NuGet release which is scheduled for 05th November 2024.

 

You can track the status of this defect using the following feedback link:  https://www.syncfusion.com/feedback/62206/duplicate-names-append-with-the-resource-key-name-while-exporting-the-customized

 

Please let us know if you need any further assistance.

Note: The provided feedback link is private, and you need to log in to view this feedback.

 

Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”


Regards,
Sudharsan



SN Sudharsan Narayanan Syncfusion Team November 5, 2024 05:50 AM UTC

Hi Slavek,

We have included the fix for the reported issue “Exception occurs thrown in the custom theme” in our Weekly NuGet release version 27.1.58 which is available for download ( https://www.nuget.org/).

 

We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.


Regards,
Sudharsan



SN Sudharsan Narayanan Syncfusion Team November 5, 2024 07:23 AM UTC

Hi Slavek,

We have fixed the reported issue in our NuGet package, but our latest theme studio application is expected to be available in our next release by mid-November. We appreciate your patience until then.

Regards,
Sudharsan



SN Sudharsan Narayanan Syncfusion Team November 15, 2024 11:31 AM UTC

Hi Slavek,

We are glad to announce that our Essential Studio® 2024 Volume 3 Service Pack Release V27.2.2 is rolled out and is available for download under the following link.


https://www.syncfusion.com/forums/195187/essential-studio-2024-volume-3-service-pack-release-v27-2-2-is-available-for-download


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.

Regards,
Sudharsan


Loader.
Up arrow icon