473,320 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How can i disable Settings written to the app.config?

At first, I was trying to encrypt ConnectionStrings in my app.config and
still be able to modify my datasets. So, i had to modify the
Settings.Designer.cs file to handle the decryption aspect in the GET
properties. This works great to run the application but there are two
problems with it when developing at designtime.

1. Anytime i add another setting to Properties, the Designer rewrites the
Settings.Designer.cs overwritting my decryption handling code.

2. I cannot modify a dataset without getting an "Object ref no found"(this
happens because it doesn't recognize the encrypted connectionString).

Being that I've been struggling through this issue now for a little over a
week, I need to know how I can disable vs.net from wrtting my
connectionstring to the app.config in clear text. In other words, I want to
add ConnectionStrings to the Properties window but i don't want them to be
written in the app.config. Everytime i link a dataset to a connection in the
server explorer, vs.net automatiaclly adds the connectionString to my
app.config in clear text. This is a huge problem for us. We've tryed setting
up Protected Configuration but it seems to not work in Windows Applications.

Dec 29 '05 #1
3 3848
Am I correct in assuming that you are using 2.0? Protected
configuration *does* work in Windows apps -- you need to set a
reference System.Configuration.dll. The other issue is which provider
to use -- DPAPI or RSA. DPAPI can only decrypt settings that were
encrypted on the same machine, so that limits its usefulness. If you
are writing code to handle encryption, I'd recommend encapsulating it
in a separate class. When you're done with the designers and ready to
deploy, hook it up and test it.

--Mary

On Thu, 29 Dec 2005 11:49:02 -0800, "Nuno"
<Nu**@discussions.microsoft.com> wrote:
At first, I was trying to encrypt ConnectionStrings in my app.config and
still be able to modify my datasets. So, i had to modify the
Settings.Designer.cs file to handle the decryption aspect in the GET
properties. This works great to run the application but there are two
problems with it when developing at designtime.

1. Anytime i add another setting to Properties, the Designer rewrites the
Settings.Designer.cs overwritting my decryption handling code.

2. I cannot modify a dataset without getting an "Object ref no found"(this
happens because it doesn't recognize the encrypted connectionString).

Being that I've been struggling through this issue now for a little over a
week, I need to know how I can disable vs.net from wrtting my
connectionstring to the app.config in clear text. In other words, I want to
add ConnectionStrings to the Properties window but i don't want them to be
written in the app.config. Everytime i link a dataset to a connection in the
server explorer, vs.net automatiaclly adds the connectionString to my
app.config in clear text. This is a huge problem for us. We've tryed setting
up Protected Configuration but it seems to not work in Windows Applications.

Jan 3 '06 #2
Thanks for the response Mary. Yes, we are using 2.0 and we have decided we
don't want the connectionstring written to the app.config. Is this possibile
with the TableAdapter? It seems no matter what I do to the connectionstring,
the designer always writes it as a setting in the app.config.

Nuno

"Mary Chipman [MSFT]" wrote:
Am I correct in assuming that you are using 2.0? Protected
configuration *does* work in Windows apps -- you need to set a
reference System.Configuration.dll. The other issue is which provider
to use -- DPAPI or RSA. DPAPI can only decrypt settings that were
encrypted on the same machine, so that limits its usefulness. If you
are writing code to handle encryption, I'd recommend encapsulating it
in a separate class. When you're done with the designers and ready to
deploy, hook it up and test it.

--Mary

On Thu, 29 Dec 2005 11:49:02 -0800, "Nuno"
<Nu**@discussions.microsoft.com> wrote:
At first, I was trying to encrypt ConnectionStrings in my app.config and
still be able to modify my datasets. So, i had to modify the
Settings.Designer.cs file to handle the decryption aspect in the GET
properties. This works great to run the application but there are two
problems with it when developing at designtime.

1. Anytime i add another setting to Properties, the Designer rewrites the
Settings.Designer.cs overwritting my decryption handling code.

2. I cannot modify a dataset without getting an "Object ref no found"(this
happens because it doesn't recognize the encrypted connectionString).

Being that I've been struggling through this issue now for a little over a
week, I need to know how I can disable vs.net from wrtting my
connectionstring to the app.config in clear text. In other words, I want to
add ConnectionStrings to the Properties window but i don't want them to be
written in the app.config. Everytime i link a dataset to a connection in the
server explorer, vs.net automatiaclly adds the connectionString to my
app.config in clear text. This is a huge problem for us. We've tryed setting
up Protected Configuration but it seems to not work in Windows Applications.

Jan 5 '06 #3
Is the connection string being created dynamically at runtime? You
might want to consider using one of the new ConnectionStringBuilders.
It allows you construct dynamic connection strings at runtime. This
avoids both hard-coding connection strings in your application and
storing them in a config file.

--Mary

On Thu, 5 Jan 2006 07:27:03 -0800, "Nuno"
<Nu**@discussions.microsoft.com> wrote:
Thanks for the response Mary. Yes, we are using 2.0 and we have decided we
don't want the connectionstring written to the app.config. Is this possibile
with the TableAdapter? It seems no matter what I do to the connectionstring,
the designer always writes it as a setting in the app.config.

Nuno

"Mary Chipman [MSFT]" wrote:
Am I correct in assuming that you are using 2.0? Protected
configuration *does* work in Windows apps -- you need to set a
reference System.Configuration.dll. The other issue is which provider
to use -- DPAPI or RSA. DPAPI can only decrypt settings that were
encrypted on the same machine, so that limits its usefulness. If you
are writing code to handle encryption, I'd recommend encapsulating it
in a separate class. When you're done with the designers and ready to
deploy, hook it up and test it.

--Mary

On Thu, 29 Dec 2005 11:49:02 -0800, "Nuno"
<Nu**@discussions.microsoft.com> wrote:
>At first, I was trying to encrypt ConnectionStrings in my app.config and
>still be able to modify my datasets. So, i had to modify the
>Settings.Designer.cs file to handle the decryption aspect in the GET
>properties. This works great to run the application but there are two
>problems with it when developing at designtime.
>
>1. Anytime i add another setting to Properties, the Designer rewrites the
>Settings.Designer.cs overwritting my decryption handling code.
>
>2. I cannot modify a dataset without getting an "Object ref no found"(this
>happens because it doesn't recognize the encrypted connectionString).
>
>Being that I've been struggling through this issue now for a little over a
>week, I need to know how I can disable vs.net from wrtting my
>connectionstring to the app.config in clear text. In other words, I want to
>add ConnectionStrings to the Properties window but i don't want them to be
>written in the app.config. Everytime i link a dataset to a connection in the
>server explorer, vs.net automatiaclly adds the connectionString to my
>app.config in clear text. This is a huge problem for us. We've tryed setting
>up Protected Configuration but it seems to not work in Windows Applications.
>
>

Jan 9 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: no | last post by:
Is there any way to disable the saved form information Mozilla Firefox and Internet Explorer presents in a list every time you type text in a form input, on a page you use every day? If so, what...
2
by: Scanner2001 | last post by:
I have a service with settings in the app.config file. I would like to be able to change these settings without restarting the service. Something similar to a web.config with web services. Whenever...
2
by: ad | last post by:
I use authorization to Form in the root Web.config But now I want to disable the Form authentication when request some web pages How can I do?
2
by: Laurent Bugnion | last post by:
Hi, I like to develop custom controls for a number of webpages. These controls are often customizable, so that they can be reused in a number of situations. My question is: What is the best...
3
by: John K | last post by:
I am trying to eliminate the capability of displaying the details of a web service by disabling WSDL generation in the web.config file. I have made the following changes to the web.config: ...
6
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a...
3
by: DaBrain | last post by:
I have a program that uses settings. When I save my settings they are saved: Properties.Settings.Default.Save(); when I restart the application, my settings are present, the changes are in...
0
by: amperie | last post by:
Hey experts, I have a vb.net (2.0) application that is basically a scheduling application. It wakes up periodically, checks to see if there's tasks to be ran and kicks off any tasks in another...
2
by: ssg31415926 | last post by:
I've got a small web site and I've added some settings in appSettings which appear in web.config. So far, so good. I've just added a DLL to the site which was originally written to be called...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.