Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to hide XML Configuration File

Tags:

c#

xml

wpf

I have just finished making my application and finished building it. And everything is working fine.

And then I notice an XML Configuration file in the folder, So I click it.

And there it is, my whole connectionstrings along with my remote sql server ip address, login username and login password which is visible for all to see.

I tried deleting the XML Configuration file and ran the program, it just makes a App_Data folder inside the folder with a default database.

Is there any way to hide the XML Configuration file or make it unreadable, as it contains all my connection info.

Thanks.

like image 712
Mark Mackanga Avatar asked Dec 31 '25 23:12

Mark Mackanga


2 Answers

Check out this MS article regarding securing your connection strings:

https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/protecting-connection-information

Alternatively, hard-code the connection string into your application (note: malicious users can reverse engineer .net apps fairly easily), or use Integrated Security if possible.

like image 54
Tom Avatar answered Jan 03 '26 11:01

Tom


You can either encrypt it: http://chiragrdarji.wordpress.com/2008/08/11/how-to-encrypt-connection-string-in-webconfig/

or use Integrated Security if you can.

like image 40
Tod Hoven Avatar answered Jan 03 '26 11:01

Tod Hoven



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!