|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Comments disappear from appSettings after Save()I have the following appSettings in my app.config file: <appSettings> <!-- Some comments here --> <add key="MyKey1" value="1"/> <!-- Some comments here --> <add key="MyKey2" value="2"/> </appSettings> After issuing the Save method as shown below, all comments under my appSettings section are gone: Dim fileMap As New Configuration.ExeConfigurationFileMap() fileMap.ExeConfigFilename = "MyApp.exe.config" Dim appConfig As Configuration.Configuration = Configuration.ConfigurationManager.OpenMappedExeConfiguration(fileMap, Configuration.ConfigurationUserLevel.None) With appConfig.AppSettings .Settings("MyKey1").Value = "10" .Settings("MyKey2").Value = "20" End With appConfig.Save(Configuration.ConfigurationSaveMode.Minimal) Any way to preserve my comments? Thanks! -- Regards, Antonio Ooi "Everyone dies, not everyone really lives" Antonio Ooi wrote:
> Any way to preserve my comments? Thanks! Upgrade to VB6! ;-)"Antonio Ooi" <antoni***@hotmail.com> wrote in message [Canned response]news:C07EB3A1-0D5F-42D0-92A7-AC2B6FC1A64A@microsoft.com... > I have the following appSettings in my app.config file: This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005 and VB Express, which have dropped .NET from their names) are off-topic here. Please ask .NET questions in newsgroups with "dotnet" in their names. The *.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.* groups on your news server, connect directly to the Microsoft server: msnews.microsoft.com. For questions specific to the VB.NET language, use this group: microsoft.public.dotnet.languages.vb Please note that things like controls and data access, which have their own subgroups in the Classic VB hierarchy, are not language-specific in .NET, so you should look for groups like these: microsoft.public.dotnet.framework.windowsforms.controls microsoft.public.dotnet.framework.adonet (Note that "vb" is not present in the group name.) Sorry, hahahahaha...............
Show quote "Jeff Johnson" <i.get@enough.spam> wrote in message news:13jro6isb7nn801@corp.supernews.com... > "Antonio Ooi" <antoni***@hotmail.com> wrote in message > news:C07EB3A1-0D5F-42D0-92A7-AC2B6FC1A64A@microsoft.com... > >> I have the following appSettings in my app.config file: > > [Canned response] > This is a VB "classic" newsgroup. Questions about VB.NET (including VB > 2005 and VB Express, which have dropped .NET from their names) are > off-topic here. > > Please ask .NET questions in newsgroups with "dotnet" in their names. The > *.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.* > groups on your news server, connect directly to the Microsoft server: > msnews.microsoft.com. > > For questions specific to the VB.NET language, use this group: > microsoft.public.dotnet.languages.vb > > Please note that things like controls and data access, which have their > own subgroups in the Classic VB hierarchy, are not language-specific in > .NET, so you should look for groups like these: > microsoft.public.dotnet.framework.windowsforms.controls > microsoft.public.dotnet.framework.adonet > (Note that "vb" is not present in the group name.) > "Antonio Ooi" <antoni***@hotmail.com> wrote in message I didn't notice the crosspost. Specifically, news:3DC56E83-33A9-4706-8994-C8EA4D6754F3@microsoft.com... > Sorry, hahahahaha............... microsoft.public.vb.general.discussion is a VB6 group. dotnet.languages.vb is definitely a good place to ask. Jeff Johnson wrote:
> "Antonio Ooi" <antoni***@hotmail.com> wrote in message Since the original was actually cross-posted, I couldn't resist stealing Mike's > news:C07EB3A1-0D5F-42D0-92A7-AC2B6FC1A64A@microsoft.com... > >> I have the following appSettings in my app.config file: > > [Canned response] > This is a VB "classic" newsgroup. classic line! <eg> "Karl E. Peterson" <k***@mvps.org> wrote in message Whoops!! Didn't notice that. I usually use the "Please don't crosspost" news:ec$Ik%23HKIHA.4272@TK2MSFTNGP05.phx.gbl... >> [Canned response] >> This is a VB "classic" newsgroup. > > Since the original was actually cross-posted, I couldn't resist stealing > Mike's classic line! <eg> version then. Jeff Johnson wrote:
> "Karl E. Peterson" <k***@mvps.org> wrote ... Whereas I just get all the more likely to climb the soapbox... <g>> >>> [Canned response] >>> This is a VB "classic" newsgroup. >> >> Since the original was actually cross-posted, I couldn't resist stealing >> Mike's classic line! <eg> > > Whoops!! Didn't notice that. I usually use the "Please don't crosspost" > version then. Jeff Johnson schreef:
> "Antonio Ooi" <antoni***@hotmail.com> wrote in message Please note that the message was posted to several groups, including a > news:C07EB3A1-0D5F-42D0-92A7-AC2B6FC1A64A@microsoft.com... > >> I have the following appSettings in my app.config file: > > [Canned response] > This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005 > and VB Express, which have dropped .NET from their names) are off-topic > here. ..NET group. Check that first before you post a canned response. -- Rinze van Huizen C-Services Holland b.v
Show quote
"C-Services Holland b.v." <cshNOSPAMPLEASE@csh4u.nl> wrote in message Why?news:-uWdnUfY-M5HSt_anZ2dnUVZ8tvinZ2d@zeelandnet.nl... > Jeff Johnson schreef: > > "Antonio Ooi" <antoni***@hotmail.com> wrote in message > > news:C07EB3A1-0D5F-42D0-92A7-AC2B6FC1A64A@microsoft.com... > > > >> I have the following appSettings in my app.config file: > > > > [Canned response] > > This is a VB "classic" newsgroup. Questions about VB.NET (including VB 2005 > > and VB Express, which have dropped .NET from their names) are off-topic > > here. > > Please note that the message was posted to several groups, including a > .NET group. Check that first before you post a canned response. > > > -- > Rinze van Huizen > C-Services Holland b.v Does it not apply when posted in several groups! How would YOU recommend informing the original person that they are asking in the wrong place? NeilH wrote:
Show quote >>> By mentioning specifically which group is inappropriate, and asking>>> [Canned response] >>> This is a VB "classic" newsgroup. Questions about VB.NET >>> (including VB 2005 and VB Express, which have dropped .NET from >>> their names) are off-topic here. >> >> Please note that the message was posted to several groups, >> including a .NET group. Check that first before you post a canned >> response. > > Why? > Does it not apply when posted in several groups! > How would YOU recommend informing the original person that they are > asking in the wrong place? them to trim it from the list when replying. You can also set followups to the most appropriate group. For example, please trim microsoft.public.dotnet.languages.vb when replying to this (-: -- Jim "C-Services Holland b.v." <cshNOSPAMPLEASE@csh4u.nl> wrote in message Please note that FOUR DAYS AGO I noticed this and posted a follow-up news:-uWdnUfY-M5HSt_anZ2dnUVZ8tvinZ2d@zeelandnet.nl... >>> I have the following appSettings in my app.config file: >> >> [Canned response] >> This is a VB "classic" newsgroup. Questions about VB.NET (including VB >> 2005 and VB Express, which have dropped .NET from their names) are >> off-topic here. > > Please note that the message was posted to several groups, including a > .NET group. Check that first before you post a canned response. message. Check that first before you post a bitchy response. Jeff Johnson schreef:
Show quote > "C-Services Holland b.v." <cshNOSPAMPLEASE@csh4u.nl> wrote in message Well, you posted a bitchy canned response. So now you know how it feels ;)> news:-uWdnUfY-M5HSt_anZ2dnUVZ8tvinZ2d@zeelandnet.nl... > >>>> I have the following appSettings in my app.config file: >>> [Canned response] >>> This is a VB "classic" newsgroup. Questions about VB.NET (including VB >>> 2005 and VB Express, which have dropped .NET from their names) are >>> off-topic here. >> Please note that the message was posted to several groups, including a >> .NET group. Check that first before you post a canned response. > > Please note that FOUR DAYS AGO I noticed this and posted a follow-up > message. Check that first before you post a bitchy response. > > -- Rinze van Huizen C-Services Holland b.v |
|||||||||||||||||||||||