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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:17:40+00:00 2026-06-08T09:17:40+00:00

I wrote a form application in c# using Visual Studio 2008, third party dlls,

  • 0

I wrote a form application in c# using Visual Studio 2008, third party dlls, an xml file and images. The images have been added to the project as resources.

A System.IO.FileNotFoundException is thrown when I attempt to run the published version of the executable on another machine.

If I copy the .exe file to the desktop on the pc, and also copy the dlls and the xml file to the desktop, double clicking on the exe works fine.

In my project, I have the copyLocal set to true for the required dll references. The xml is added to the project and set to copy if newer to output directory. I also checked the publish application files and everything is there.

The line I use to load the xml file is this

config = new XmlDocument();
config.Load("fileName.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-08T09:17:43+00:00Added an answer on June 8, 2026 at 9:17 am

    I’m assuming the FileNotFound exception is being thrown when you try to load the XML file, right?

    Simply looking for “filename.xml” doesn’t seem like a fantastic idea to me, especially if this is a key configuration file for your application.

    I typically try to move these things into my App.config file then load them either using a fully qualified path or a short path. For example:

    App.config

    <add key="ExternalConfig" value="D:\\config.xml"/>
    

    .cs file

    config = new XmlDocument();
    config.Load(ConfigurationManager.AppSettings["ExternalConfig"]);
    

    You could also use a relative path, but keep in mind that you’re always relative to the current working directory.

    Alternatively, based on the type of data in your configuration, you could try to store this information to you App.config file and do away with a config.xml altogether.

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

Sidebar

Related Questions

Let's create WinForms Application (I have Visual Studio 2008 running on Windows Vista, but
I am developing Windows Form Application using Microsoft Visual C# 2010 I have two
I am creating Windows Application Form using Visual Studio 2010. For now, I am
In C# and .NET, I wrote an application that runs in a Form (using
How can I write C# application using Visual Studio 2010 that runs in background?
I have a C# form application that connects to a electronic device using the
I am adding some data to Excel file using C# Window form application. But
I wrote a form using the Form API in Drupal 6. Everything else works
Using Swing in Java I wrote a form containing radio buttons, text fields and
i wrote in file showList.php the following form, which select items from the database

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.