Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

VS 2008 -- DEPLOY -- Hide ".config" file ?

Posted on 2009-07-13
3
Medium Priority
?
438 Views
Last Modified: 2013-12-17
How can I
 1. get just the "PV.exe" Desktop icon to display
     when doing the below, instead of also displaying
     the "PV.exe.config" DESKTOP icon ?
 2. hide the C:\Program Files\PVAPP\PV.exe.config
    "config" file from users so they cannot see
     the database connection string ?
------------------------------------------------------------
Deploying APP
 1. rightClick "Solution", Add, New Project
 2. Other Project Types, Setup and Deploy, Setup Wizard
 3. Name = anything
 4. Check below
     ** Localized Resources from ...
     ** Content Files from ...
     ** Primary Output from ...
 5. Finish
 6. RightClick "User Desktop"
     ** Add, Project Output, OK
 7. RightClick "User Programs Menu"
     ** Add, Project Output, OK
 8. RightClick on new PROJECT, Build
 9. run "...\Release\PVAPP.msi" on client
10. Desktop ICONs display
        ** PV.exe & PV.exe.config
11. run APP
12. works
0
Comment
Question by:finance_teacher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 21

Expert Comment

by:Craig Wagner
ID: 24843882
I don't know what is causing the config file to show up as an icon, but as far as protecting your configuration file connection strings, encrypting them is probably a better choice than trying to hide the file, because no matter how you try to hide the file a determined user can still find it.

Here's a simple way to encrypt the sensitive information.

1. Rename the applications configuration file to web.config.

2. If encryption of the connection strings section is required, execute the following command to encrypt the connectionStrings section:

    aspnet_regiis -pef connectionStrings <install folder>

3. If encryption of the application settings section is required, execute the following command to encrypt the appSettings section:

    aspnet_regiis -pef appSettings <install folder>

4. Rename the file back to the correct name (i.e. <name-of-executable>.config).
0
 

Author Comment

by:finance_teacher
ID: 24844141
This is a non-web "Windows APP".
Would I still use "aspnet_regiis -..." ?
0
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 2000 total points
ID: 24844169
Yes. The .NET framework does not provide a simple way to encrypt the app.config, so we fake it into thinking it's a web.config (that's why the first step of the instructions is to rename the application's config file to web.config).
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question