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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:39:46+00:00 2026-06-13T16:39:46+00:00

I have some problem with URI into two last code rows: I try get

  • 0

I have some problem with URI into two last code rows: I try get XML from application resources, and from site. Before it, I executed the same operations with the image – everything worked fine. Exception message in a comments.

// Get image from site: 
// "pack://siteoforigin:,,,/http://www.designdownloader.com/item/pngs/user_f036/user_f036-20111114102144-00003.png"

// Get image from building resources (Build Action = Resources).
Uri uri_male_default = new Uri("pack://application:,,,/male.png");

// Get image from site: 
// "pack://siteoforigin:,,,/http://www.designdownloader.com/item/pngl/user_f046/user_f046-20111114102341-00003.png"

// Get image from building resources (Build Action = Resources).
Uri uri_female_default = new Uri("pack://application:,,,/myImages/famale.png"); 

// Create images (it's works fine):
img_male_default = new BitmapImage(uri_male_default);
img_female_default = new BitmapImage(uri_female_default);

//The next both cases ain't working:
// NotSupportedException: URI prefix isn't recognized.     
XElement xml_1 = XElement.Load("pack://application:,,,/SettingsX.xml"); // Get XML from building resources (Build Action = Resources).
XElement xml_2 = XElement.Load("pack://siteoforigin:,,,/https://skydrive.live.com/?cid=51b3145b64e05fef&id=51B3145B64E05FEF%21550");

The XElement.Load get an URI as parameter. Why I can’t to do it with XML?

  • 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-13T16:39:47+00:00Added an answer on June 13, 2026 at 4:39 pm

    Judging by the error description I highly doubt whether it’s possible to pass a WPF pack URI to XElement.Load but you can always use the relative path and it will work, sample code below:

    Uri uri = new Uri("/SettingsX.xml", UriKind.Relative);
                System.Windows.Resources.StreamResourceInfo info = Application.GetResourceStream(uri); 
                XElement settings = XElement.Load(info.Stream);
    

    EDIT:

    To get the xml file from the web:

    private void button1_Click(object sender, RoutedEventArgs e)
    {
        string url = "Your URL...";
        var webClient = new System.Net.WebClient();
        webClient.DownloadStringCompleted += HttpsCompleted;
        webClient.DownloadStringAsync(new Uri(url));
    }
    
    private void HttpsCompleted(object sender, System.Net.DownloadStringCompletedEventArgs e)
    {
        if (e.Error == null)
        {
            XDocument xdoc = XDocument.Parse(e.Result, LoadOptions.None);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some problem to get the utf-8 string from PHP using jQuery $.load()
I have some problem with my code public IQueryable<PageItems> GetPageById(Guid Id) { var xml
I have some problem in my JDBC code. I am trying to connect through
I have some problem with Emit mapper when I try to save in database
There are two problems I ran into last night which I have resolved now,
I have a problem with the SBJSON Parser. I'm trying to get some information
I'm currently attempting to unmarshal some existing XML into a few classes I have
I have some problem with the cursor when using JOprionPane. I set a cursor
I have some problem. Dialog.dismiss() does not work. I want to input ip, username,
I have some problem with this mongoid. It's my first time to use mongoDB,

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.