C# resource not found at design time

design-time errors in the windows forms designer
visual studio form designer not showing
"visual studio 2017" form designer not showing
visual studio 2019 design view not showing
the designer could not be shown for this file because none of the classes within it can be designed
vsxaml_disable_on_demand_resource_values
visual studio form design disappeared
net core winforms designer not working

Since a few days I get a "Resource not found" message when opening any of my xaml files, compiling and executing the application however is no problem. I am using MahApps.Metro for my UI design and already tried to clean and rebuild the whole solution and also "reinstalled" the MahApps.Metro (version 1.4.3) package using Visual Studio Blend 2015.

My App.xaml looks like this: (There are more styles defined, but the WindowStyle shows the "Resource could not be resolved" error)

<Application x:Class="Edge_Player.App"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:local="clr-namespace:Edge_Player"
         xmlns:metro="http://metro.mahapps.com/winfx/xaml/controls"
         xmlns:system="clr-namespace:System;assembly=mscorlib"
         StartupUri="Player.xaml">
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="Theme/Dark.xaml"/>
            <ResourceDictionary Source="Localization/StringResources.xaml"/>
            <ResourceDictionary Source="Resources/Icons/Icons.xaml"/>

            <!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatButton.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/FlatSlider.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
            <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />

            <ResourceDictionary Source="Theme/Base/Dark.xaml"/>
            <ResourceDictionary Source="Theme/Accents/Orange.xaml"/>
            <ResourceDictionary Source="Controls/Slider.xaml"/>
            <ResourceDictionary Source="Controls/Menu.xaml"/>
        </ResourceDictionary.MergedDictionaries>
        <system:Double x:Key="WindowTitleFontSize">14</system:Double>

        <BitmapImage x:Key="DesignCover" UriSource="Resources/emptyCover.png"/>
        <BitmapImage x:Key="DesignImage" UriSource="Resources/osu_mp_wallpaper.jpg"/>

        <Style x:Key="WindowStyle" 
           TargetType="{x:Type metro:MetroWindow}" 
           BasedOn="{StaticResource {x:Type metro:MetroWindow}}">
            <Setter Property="Background" Value="{DynamicResource Primary}"/>
            <Setter Property="Foreground" Value="{DynamicResource Accent}"/>
            <Setter Property="BorderBrush" Value="{DynamicResource Border}"/>
            <Setter Property="GlowBrush" Value="{DynamicResource Border}"/>
            <Setter Property="NonActiveBorderBrush" Value="{DynamicResource Warn}"/>
            <Setter Property="NonActiveGlowBrush" Value="{DynamicResource Warn}"/>
            <Setter Property="NonActiveWindowTitleBrush" Value="{DynamicResource PrimaryDark}"/>
            <Setter Property="WindowTitleBrush" Value="{DynamicResource PrimaryDark}"/>
            <Setter Property="ShowIconOnTitleBar" Value="False"/>
        </Style>

All of the DynamicResources used in the "WindowStyle" are defined in a seperate file.


I just found out what caused this behaviour to occur: In the XAML editor, project code has been deactivated somehow... (I feel so stupid right now)

DesignTime Resources does not work in VS 2017, This error only occurs at DesignTime at Runtime everything is fine and the Resources are found. Show comments 7. This issue is read only,  ResourceDictionary not found in design time. (The resources are loaded at design time and intellisense works perfect.): Calculate relative time in C#. 669.


After few hours i found out that problem is Platform Target set to x64.

After changing it to AnyCPU the resources in design works..

Design-time errors in the Windows Forms Designer, For Visual Basic apps, the design-time error page does not display A third- party designer has tried to access a tab on the Toolbox that does not exist. Error reading resources from the resource file for the culture '<culture  If not then you could force an additional load of the resource dictionary as a design time only resource. One final tip though. If you're using "modern" style icons which are therefore flat and simple you should consider using geometries to define graphics instead of png.


I had a similar issue, however, my project was active and in a different solution. The problem was adding a new resource to an existing project. The resources from the preexisting worked in design and run-time, but only run-time for the new resource file.

The solution was easy. I removed the .sou file or the .vs folder (depending on version) and all my resources worked in design time.

The .sou or .vs is the root of all evil in the world today when they go wrong. Removing them resolves so many issues. I should have tried this first.

XAML or WPF designer can't find resource dictionary keys in Visual , “Cannot find resource named” error in XAML or WPF designer in Visual Studio 2017 display error messages in Design view can be found in the application resource dictionary. This can cause a small reduction in designer load time. No. Tell us what we can do to improve the article. Submit. Thanks! Once you have at least one design-time resource dictionary in your project, the Resource pane will show you that dictionary under "Design time resouces". You can right click on that and add new design-time resources. If you never had any design-time resource dictionary and suppressed the dialog, you are pretty much out of luck :).


ResXResourceWriter Class (System.Resources), Writes resources in an XML resource (.resx) file or an output stream. bugs, ResXResourceWriter does not allow a.resx file to have names that vary only by case. For more information on the format of a.resx file, see Working with .resx Files Adds a design-time property whose value is specified as a string to the list of  This error is displayed when the code used to create the designer has called the type resolution service from a thread other than the main application thread. To correct this error, call the service from the correct thread or contact the component vendor.


Define XAML resources, Understand the types of XAML resources and learn how to define XAML When determining the overall design of how you create the resources for your app (per Are updating resources in real-time part of your app requirements? by a dynamic resource reference in XAML and was not found, then the  The static resource keys of the UI components that display error messages in Design view can be found in the application resource dictionary. This issue doesn’t occur at run time. This issue doesn’t occur if project code is disabled.


Resx files are not generated in the design time build · Issue #1521 , GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together. Sign up. A specific resource map can be specified when the ResourceLoader is obtained; if no resource map is specified, the ResourceLoader will provide access to the "Resources" subtree of the app's main resource map. In general, resources can be sensitive to scale or other display characteristics.