Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6928161
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:08:54+00:00 2026-05-27T11:08:54+00:00

I have a very simple set of styles that I’m using in a couple

  • 0

I have a very simple set of styles that I’m using in a couple of different WPF applications. I have this style stored in a Xaml file in a common project, then added by merging into the Resources in App.xaml in each of the projects.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity">
    <Style TargetType="dxe:ComboBoxEdit">
        <Setter Property="AutoComplete" Value="True" />
        <Setter Property="IncrementalFiltering" Value="True" />
        <Setter Property="ImmediatePopup" Value="True" />
        <Setter Property="IsTextEditable" Value="True" />
        <Setter Property="ClearSelectionOnBackspace" Value="True" />
    </Style>
    <Style TargetType="dxe:ComboBoxEditSettings">
        <Setter Property="AutoComplete" Value="True" />
        <Setter Property="IncrementalFiltering" Value="True" />
        <Setter Property="ImmediatePopup" Value="True" />
        <Setter Property="IsTextEditable" Value="True" />
    </Style>
</ResourceDictionary>

Unfortunately, something about this is causing a XamlParseException regarding the TargetType property, but only when not attached to the debugger. If I start the application in the debugger, everything is fine. If I “Start Without Debugging”, I get this as App.xaml is being loaded:

System.Windows.Markup.XamlParseException: 'Failed to create a 'TargetType' from the text 'dxe:ComboBoxEdit'.' Line number '5' and line position '12'. ---> System.Xaml.XamlParseException: Type reference cannot find type named '{http://schemas.devexpress.com/winfx/2008/xaml/editors}ComboBoxEdit'.
   at MS.Internal.Xaml.Context.ObjectWriterContext.ServiceProvider_Resolve(String qName)
   at MS.Internal.Xaml.ServiceProviderContext.System.Windows.Markup.IXamlTypeResolver.Resolve(String qName)
   at System.Xaml.Replacements.TypeTypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateObjectWithTypeConverter(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateFromValue(ServiceProviderContext serviceContext, XamlValueConverter`1 ts, Object value, XamlMember property)
   at System.Xaml.XamlObjectWriter.Logic_CreateFromValue(ObjectWriterContext ctx, XamlValueConverter`1 typeConverter, Object value, XamlMember property, String targetName, IAddLineInfo lineInfo)
   --- End of inner exception stack trace ---
   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.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
   at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
   at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   at Shell.App.InitializeComponent() in c:\DevProjects\CoreApplication\Shell\App.xaml:line 1
   at Shell.App.Main() in C:\DevProjects\CoreApplication\Shell\obj\x86\Debug\App.g.cs:line 0

If I comment out both Style nodes, then everything works correctly. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:08:55+00:00Added an answer on May 27, 2026 at 11:08 am

    I had the same kind of issue, and for me it was the way the resource files were added to the project.

    I had to make sure each and every one of my xaml style resource files were set up as “Page” (in the “build action” property). By default, they were not all in this mode (some as “Content”, other as “compile” or “embedded resource” or “resource”) and that caused this kind of issue.

    maybe it’s the same for you…

    edit : from what I could gather, it has something to do with how the xaml code is embedded in the project and specifically the Order in which it is parsed by WPF: if the source file is set as “Page”, the order in which the dictionary are merged is not taken into account, so this would work in release mode:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <!-- let's say this dictionary contains a call to "MyButtonStyle" ... -->
                <ResourceDictionary Source="resources/Common.xaml" />
                <!-- ... and this one contains the definition of "MyButtonStyle" -->
                <ResourceDictionary Source="resources/GeneralResources.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
    

    but this would not work with the other options (not all of them anyway, I did not try every single one of them) since the call would be parsed before the definition.

    As to why it works in debug mode and not in release (or in your case when you start without debug), I guessed it was because WPF parses and stores resources into memory differently depending on the mode you’re in (debug or not). I think WPF stores everything in memory in debug mode while it only stores what it needs in release mode (so for instance the calling code and not the definition code), but then again, it’s just my guess…

    edit 2: for me it was a nightmare to debug because it was even worse: it worked in some release configurations and not others because depending on the order of the actions taken by the user, he would get the error or not (the resource might already have been charged in memory or not when called, depending on what WPf already needed at this point), and of course I could not “debug” per say, since the debug mode always worked… It took me a while before figuring this solution out… glad it helped

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple .htaccess file set up to redirect a 404 to
I have a very simple script: #!/bin/bash gnuplot << EOF set term postscript portrait
I have a very simple script that creates a user: <?php include 'mysqlserver.php'; session_start();
I have coded a very simple Word Count program that reads a file and
I'm trying to keep my HTML very simple. I have a set list which
I've created a very simple CSS that styles two buttons. To the first has
I'm very new to WPF and am writing an application using this example as
I have a very simple code that should draw a circle, but its not
I have a very simple question. Trying to figure out what is the simplest
I have very simple piece of code. The goal is when i input four-digit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.