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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:19:23+00:00 2026-05-26T04:19:23+00:00

Currently, my application automatically encrypts its own App.config file the first time the application

  • 0

Currently, my application automatically encrypts its own App.config file the first time the application is launched.

I’m using the ConfigurationManager class as demonstrated in this article:

  • Encrypting Passwords in a .NET app.config File

Now I want the App.config to already be encrypted before the application launches the first time.

Reason why is that I have added an installer to my solution and I don’t want an installer that drops an un-encrypted App.config. I want the process to be automated.

(only thing I came up with so far is attaching an .exe to the Post-Build Event, but isn’t there a more straight forward way?)

  • 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-26T04:19:23+00:00Added an answer on May 26, 2026 at 4:19 am

    First Option: Using built in MSBuild Exec Task execute own utility program which is able to encrypt configuration file.

    Second Option: Own MSBuild task

    I believe you can write a simple MSBuild Task which will find App.Config file and then encrypt it whilst Solution build.

    1. Create a new MSBuild Targets like EncryptConfig.targets
    2. Update csproj file by <Import Project="EncryptConfig.targets" />
    3. Add DependsOnTargets for standard AfterBuild targets in csproj:
     <Target Name="AfterBuild" DependsOnTargets="EncryptConfig.targets" />
    

    4) Write own task and execute it in EncryptConfig.targets

    How-to write own task:

    • Task Writing
    • An MSBuild Task to run C# code
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently trying to build a class hierarchy automatically by using C++ templates. The
I'm currently creating an application for a customer that will allow them to automatically
An application currently in development has the requirements for using MS Word to perform
Currently our Java application uses the values held within a tab delimited *.cfg file.
Currently developing an application using the newest version of symfony, obtained through PEAR. This
The app I'm currently developing depends on a third party application (OIFileManager). My question
I currently have a .NET class library written in C# that exposes its functionaility
I'm currently upgrading my application to use jQuery 1.6.1 (previously using 1.4.4) and found
Currently we have developed application using Java 6 based on windows 32bit(Dual core &
I'm currently working on an app that allows the user to play (automatically scroll)

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.