How to secure connection strings in VS?
Posted
by salvationishere
on Stack Overflow
See other posts from Stack Overflow
or by salvationishere
Published on 2010-04-23T22:25:19Z
Indexed on
2010/04/23
22:43 UTC
Read the original article
Hit count: 186
I see several others have posted this question, however, none of the solutions I've tried have fixed this yet. I have a 32-bit XP running VS 2008 and I am trying to encrypt my connection string in my web.config file.
But I am getting the error: The configuration section '...' was not found. Failed!
The command I give it: C:\Program Files\Microsoft Visual Studio 9.0\VC>Aspnet_regiis.exe -pe "system.we b/AdventureWorksConnectionString2" -app "/Documents and Settings/Admin/My Docume nts/Visual Studio 2008/Projects/AddFileToSQL2"
Also, how does -app map virtual directory? In other words the path above is the directory right below c:. Is this the correct path to use? And AddFileToSQL2 is the name of my project, although it is part of the AddFileToSQL solution.
I have this folder web shared with all of the permissions.
And the relevant part of my web.config file:
<add name="AdventureWorksConnectionString2" connectionString="Data Source=SIDEKICK;Initial Catalog=AdventureWorks;Persist Security Info=true; User ID=AdventureWorks;Password=sqlMagic"
providerName="System.Data.SqlClient" />
© Stack Overflow or respective owner