Solved

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

Posted on 2009-07-13
3
420 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
  • 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 500 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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now