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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:35:08+00:00 2026-06-04T17:35:08+00:00

When I build a Visual Studio project, the executable is written to the output

  • 0

When I build a Visual Studio project, the executable is written to the output directory specified in the projects Property Page.

I have a project that has some extra files (e.g., .ini file) that are used by the program.

How can I configure the project to copy the file to the output directory so that when the program runs, it has a copy of the other file in its CWD?

I checked the Property Page of the file and there was nothing useful other than an option to exclude it from the build (which is disabled), and the custom-build-tool command is empty (plus it is a plain-text file that does not need any processing).

  • 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-04T17:35:09+00:00Added an answer on June 4, 2026 at 5:35 pm

    While I was searching the file’s Property Page for a build-action field, I had a thought: set the custom build step to copy the file (manually). This turned out to be easier than I thought. I had figured it would require using cmd or other external executable (xcopy, robocopy, etc.), but that is not necessary.

    I set the Custom Build Step as follows:

    Command Line : copy $(InputFileName) $(OutDir)
    Description  : Copying foobar...
    Outputs      : $(InputFileName)
    

    Setting the outputs field (correctly) was critical in order to prevent VS from always thinking the project is out of date and requiring to be rebuilt (I’m not certain if it needs to be prefixed with $(OutDir)\).

    It is reflected in the Output window as such:

    Copying foobar...
            1 file(s) copied.
    Compiling resources...
    Linking...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to build a project in Visual Studio 2005 that has a
I have a C# Visual Studio project (.csproj) that has a reference to the
I have a custom build target in a visual studio 2008 c# project. Is
I have a solution that I am trying to build in Visual Studio which
I have a WCF project in Visual Studio that I need to deploy to
I have a Windows, C++ software project (built with Visual Studio 2005, SP1) that
I have a project that's not really big. With Visual Studio's C++ compiler the
I have a VERY simple C# Winforms project that I made using Visual Studio
I'm not using the default Visual Studio project path to build my program into,
When I create a Silverlight project in the Visual Studio, then build it, the

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.