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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:10:18+00:00 2026-06-16T05:10:18+00:00

I have created a console application responsible for generating exports of data from a

  • 0

I have created a console application responsible for generating exports of data from a database. This has to be deployed to a batch server which is different than where the database is running. In the app.config I need to configure the connectionstring to the database. I am having about eight environments where I need to deploy this console application. Upto now I needed to store the original configuration file for each environment and copy it separately to the installation folder.

The first thing I know was adding the files to the setup project in Visual Studio. Next to the primary output I have added all configuration files with a condition property on them. I added a screen to the setup wizard (textbox) where I ask the user installing to enter the environment name as I have specified. I got this configured succesfully in one of the setup projects, but in two projects my solution is not correct. In those I always end up with my app.config file in the installation folder and not with the configuration file I have created in the setup project. When I rename the files, I only see them when I enter the correct details during setup. So my guess is that my files are somehow overwritten with the app.config from my project.

The build result of my setup:

Building file 'C:\MyProject\MyProject.Setup\Deploy\MyProject.msi'...
Packaging file 'MyProject.exe.config'...
Packaging file 'MyProject.exe'...
Packaging file 'MyProject.exe.config'...
Packaging file 'MyProject.exe.config'...

Does anyone know what is failing here? Do I need special conditions or settings? Or maybe another deployment stragegy. Manually editing the configuration files is not an option. I appreciate all help. Thanks in advance.

  • 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-16T05:10:19+00:00Added an answer on June 16, 2026 at 5:10 am

    If it is only about the connection string, add a reference to a second config file which you deploy to your folder, like:

    <connectionStrings configSource="connectionstrings.config" />
    

    Or deploy your complete config file seperately, and load it in your application like:

    var map = new ExeConfigurationFileMap {ExeConfigFilename = @"C:\MyProject\custom.config"};
    Configuration config = ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a console application which transfers data from an excel sheet and
I have created a C# console application that contains the namespaces System and System.Data
For the sake of demonstration, I have created this simple console application: #include <iostream>
I have created a Console application for validating a function and this application i
I have created a small chatting application in C#, and started as a Console
I have a console application from which I create a window. I can render
I created a Console application, and want it to run on our server. But
I have a Visual C console application (created in VC++2008EE) and I need to
I have created a console application in which I have exposed interface having [OperationContract(IsOneWay
I have created a console application which goes through all site collections and thier

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.