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 8313919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T20:39:08+00:00 2026-06-08T20:39:08+00:00

I am developing a user control and use it inside an ElementHost. I define

  • 0

I am developing a user control and use it inside an ElementHost. I define the resource dictionary as follows:

<UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Themes/Classic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary> 
    </UserControl.Resources>

In my VS explorer, I have this

Project (the user control library)
  |_ Themes
       |__ Generic.xaml  (Build Action = Page)
       |__ Classic.xaml  (Build Action = Page)

There’s no compilation error and the VS designer seems to pick up the resources defined in Classic.xaml

However, it crashes at runtime with the following exception:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.Windows.Markup.XamlParseException: ‘Set property ‘System.Windows.ResourceDictionary.Source’ threw an exception.’ Line number ’16’ and line position ’18’. —> System.IO.IOException: Cannot locate resource ‘themes/classic.xaml’.

What’s going on?

  • 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-06-08T20:39:10+00:00Added an answer on June 8, 2026 at 8:39 pm

    I ended up having to use the syntax that includes the assembly name… don’t ask me why

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/assemblyname;component/Themes/Classic.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary> 
    </UserControl.Resources>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a user preferences page and I've decided to use AngularJS to control
I am developing a user control and it has an asp.net button inside jQuery
I am developing a website using PHP. I use Javascript/jquery to control/regulate user input.
I am currently developing some user controls so that I can use them at
I'm developing user control in C# Visual Studio 2010 - a kind of quick
I am developing a user control (ascx) in ASP.NET which uses javascript for manipulating
I am developing a WPF User Control for displaying portions of XML files. I'm
I am developing a user manager which must control access to the detail view
I'm developing an app using Silverlight control for Bing Maps . User can search
I would like to show my user control inside row details. I have a

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.