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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:59:14+00:00 2026-05-18T03:59:14+00:00

I have a WinForms app that I am trying to deploy with ClickOnce. It

  • 0

I have a WinForms app that I am trying to deploy with ClickOnce. It consists of an executable and a dependent dll, plus a bunch of loose xml files in a folder called “Map”. The xml files all seem to be present and correct in the generated clickonce package and are all included in the .manifest file.

However, when I install and run, using the following code gives me a directory not found exception:

string appPath = Path.GetDirectoryName(Application.ExecutablePath);
string mapPath = Path.Combine(appPath, "Maps");
foreach (string xmlFile in Directory.GetFiles(mapPath, "*.xml"))

when I look in “appPath” (which is C:\Users\Mark\AppData\Local\Apps\2.0\0H6ZLXXN.30V\3TNO49OJ.8JH\midi..tion_5194807c0e95e913_0000.0004_b9d52c73fd4d58ad\), there is the app executable and dll, but the Maps folder is not there.

What am I doing wrong? Is this the correct way to be bundling extra files with my application? I would actually like the Maps folder to be somewhere the user can easily access and add their own files to anyway.

  • 1 1 Answer
  • 3 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-18T03:59:15+00:00Added an answer on May 18, 2026 at 3:59 am

    ok, I eventually found a code snippet that helped me out. The xml files were already being put into the ClickOnce “data directory” (this can be configured using the “application files” button on the publish tab of the project settings dialog. Then you can get at the data directory as follows:

        private string GetDataDirectory()
        {
            if (ApplicationDeployment.IsNetworkDeployed)
            {
                return ApplicationDeployment.CurrentDeployment.DataDirectory;
            }
            else
            {
                return Application.StartupPath;
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a WinForms app that I am trying to make full screen (somewhat
I have a winforms app that initially displays a window with two file dialog
I have a Winforms app that has a DataGridView that is databound at runtime.
I have a winforms app that checks user credentials as it starts. If autharization
I have a small WinForms app that utilizes a BackgroundWorker object to perform a
I have a DataGridView in a Winforms app that has about 1000 rows (unbound)
I have a test winforms app with ThreadExceptionHandler that displays a message box when
I have a winforms (VB 2008) based app that I'm developing and I want
I have a winforms app, that's locking up during a web service request I've
I'm working with a WinForms app. I have an RDLC report that will be

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.