Save app.config

  • Thread starter Thread starter ivano
  • Start date Start date
I

ivano

Hi,
if I use the save method of ConfigurationManager.OpenExeConfiguration and
the xml.InnerText is string.empty, the tag is formed as:
<value>
</value>
instead of
<value></ value> or <value />

I there is a value is all ok. (<value>something</value>)

Is some wrong setting or bug ?

Thanks
 
Hello Ivano,

Thank you for using Microsoft Newsgroup Support Service. My name is
Lingzhi Sun [MSFT]. It's my pleasure to work with you on the case.

The problem that you reported can be reproduced on my side. When I set
the SettingElement.Value.ValueXml.InnerText to an empty string, the
corresponding value tag is formed as
<value>
</ value>
This issue occurs when I try to modify both the user settings and the
application settings. The product group and I are researching the root
cause of this problem. We will let you know the result as soon as
possible.

Ivano, could you please let me know how this issue impacts your
application? With the background information, we will do our best to
figure out some appropriate workarounds which suit your specific concern.
If you want to modify the configuration file during application runtime,
here are some possible workarounds.

================
For User Settings:
The user settings are loaded from a file named "user.config" which is under
your user profile. It is generally recommended to use the method that the
following link suggested to modify user settings directly on the
"user.config" file: http://msdn.microsoft.com/en-us/library/shytyc55.aspx.

================
For Application Settings:
Quote from http://msdn.microsoft.com/en-us/library/shytyc55.aspx.
"Although you can change and save the values of user-scope settings at run
time, application-scope settings are read-only and cannot be changed
programmatically. You can change application-scope settings when you create
the application by using the Project Designer or by editing the
application's configuration file. For more information, see
http://msdn.microsoft.com/en-us/library/a65txexh.aspx ."

However, we can treat the configuration file as an XML document to change
the application settings inside. You can find such a method from this
helpful MSDN blog article:
http://blogs.msdn.com/mosharaf/archive/2007/01/19/changing-application-setti
ngs-programmatically-in-net-framework-2-0.aspx.

If you have any other questions, please be free to let me know.

Have a nice day!

Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

MSDN Managed Newsgroup support offering is for non-urgent issues where an
initial response from the community or a Microsoft Support Engineer within
2 business day is acceptable. Please note that each follow up response may
take approximately 2 business days as the support professional working with
you may need further investigation to reach the most efficient resolution.
The offering is not appropriate for situations that require urgent,
real-time or phone-based interactions. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/en-us/subscriptions/aa948874.aspx
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hello Ivano,

The product team has confirmed that the problem that you reported is a
product issue. They will investigate this issue in the future release of
our product.

Besides, would you please let me know if the workarounds that I provided
help you. If you need further assistance, please be free to let me know.
I wll be more than happy to be of assistance.

Have a nice day!

Regards,
Lingzhi Sun ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 
Back
Top