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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:15:17+00:00 2026-05-26T04:15:17+00:00

My question is: Am I reading MSDN wrong OR is MSDN wrong? I am

  • 0

My question is: Am I reading MSDN wrong OR is MSDN wrong? I am trying to reference an image Resource via relative URI.

The MSDN page titled Pack URIs in WPF clearly states that:

“Resource file in subfolder of local assembly” = “/Subfolder/ResourceFile.xaml“

in Table 2: Relative URIs in Markup (here
http://msdn.microsoft.com/en-gb/library/aa970069.aspx ).

So, I created new WPF/.NET 4.0 projects in Vs2010 (v10.0.40219.1 SP1Rel) to test.

Startup Project: TryUri
    App.xaml
    MainWindow.xaml
Custom Ctrl Project: TryUri.CCL
    Icons/folder.png <-- Marked As Resource!
    Views/TestUC.xaml

In TestUC.xaml:

<Canvas>
    <Border>
        <Image Source="/Icons/folder.png" Height="Auto" Width="Auto" />
    </Border>
</Canvas>

In MainWindow.xaml:

// xmlns:uc="clr-namespace:TryUri.CCL.Views;assembly=TryUri.CCL"

<uc:TestUC />

Result: The image does not show up!!

When I change the path to “../Icons/folder.png” It does work.

If I copy the Icons/folder.png into the TryUri.CCL/Views/ folder, then “Icons/folder.png” works.

However, I can never get a leading forward slash to work as in “/Icons/folder.png” the way that MSDN states.

  • 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-26T04:15:18+00:00Added an answer on May 26, 2026 at 4:15 am

    The reason, when running as a separate assembly, that your Relative Pack URI must begin with ../ or no leading backslash is because of how relative URIs are used, from MSDN (emphasis mine):

    Absolute vs. Relative Pack URIs

    …

    If a leading backslash is used, however, the relative pack URI reference is then considered relative to the root of the application.

    Therefore if you’d like the images to remain relative to your referenced assembly, simply omit the leading slash or use ../ if in a sub-folder.

    See the image below for an example of how this looks at runtime:

    Absolute vs. Relative Pack URIs

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

Sidebar

Related Questions

After reading the MSDN reference, I still have questions about when to use the
I was just reading a page on events on MSDN, and I came across
the reason I asked the question was because after reading the msdn advice on
I am reading SQL Server lock escalation from MSDN Page about SQL Server lock
as I think I can answer this question to myself by reading the MSDN
A question about updatable db views: I'm reading through some MSDN documentation on the
After posting this question and reading that one I realized that it is very
This is a continuation of my question about reading the superblock . Let's say
Please read my update at the end of question after reading the answers: I'm
After reading this question , I was reminded of when I was taught Java

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.