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

  • Home
  • SEARCH
  • 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 1033443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:14:01+00:00 2026-05-16T14:14:01+00:00

I am in trouble, so need some help. I have my file stored in

  • 0

I am in trouble, so need some help.
I have my file stored in the following path–>

H:\Testapps\appz\Sample1\Sample1\Data.xml

I am trying to load the xml file in an XMLDOCUMENT like this –>

XMLDocument xdoc=new XMLDocument();
string xmlfile = "..\Sample1\Data.xml";
xdoc.Load(xmlfile);

I get an error –

Could not find a part of the path
‘H:\Testapps\appz\Sample1\Sample1\bin\Debug\Sample1\Sample1\RemData.xml’.

How do i proceed in specifying the xmlfile path??
Any help appreciated!


Another problem i am facing is when i try to write new node in an existing xml file by providing just the name of the xml file, i do not see contents saved in the xml file.

But if i provide the complete path for the xml file, the data gets saved in the aml file.

I am using

xdoc.Save("RemData.xml");

I want a partial file path rather than H:\Testapps\appz\Sample1\Sample1\bin\Debug\Sample1\Sample1\RemData.xml but how?

  • 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-16T14:14:01+00:00Added an answer on May 16, 2026 at 2:14 pm

    You are using a relative path. Doing so means that you’re telling the application to use the executable’s directory as the “root path”. What you probably want is to automatically have the XML files copied to the output directory. To do this, I usually set the “Build Action” property for the XML file to “Embedded Resource” and set “Copy to Output Directory” to “Copy Always”. Hope this helps.

    BTW, you might also want to take a look at Pack URI’s.

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

Sidebar

Related Questions

I'd need some help to design a monadic datatype, I seem to have trouble
I need some help writing an http client. The trouble comes when I try
I have trouble using sed. I need to replace some lines in very deprecated
I'm having some trouble dumping a query result into a XML file. I've read
I'm trying to learn reflection in C# and need some help with my code.
I'm having some trouble using XmlReader to read an XML file. I can open
i need some help for my project. i have an ImageView inside GridView. i
I need some help with my problem. I have created a list of all
I am having some trouble building the query I need to return the AccountID
I need to open a log file for writing. Trouble is, many things may

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.