DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 22 Aug 2007 23:34:01 -0700,    posted on: microsoft.public.dotnet.general        back       

Thread Index
  1    sujith


strange about settings in .net 2.0   
created a simple windows service and a set up project for that .I uses 
Settings feature in .net 2.0.It has a windowsservice1.settings file with a 
user scope variable named “Settings1” with a default value “A”. 

In the custom installation file I change the value of the settings1 variable 
to  a new value “ZB” and saves it.In the start event of the service I write 
this value to a text file .But I get the old value “”A”.But this works with a 
windows application.

Do you have any ideas on this?

 

protected override void OnAfterInstall(System.Collections.IDictionary 
savedState)

        {

            System.Diagnostics.Debugger.Break();

            base.OnAfterInstall(savedState);

            global::WindowsService1.WindowsService1.Default.Setting1 = "ZB";

            global::WindowsService1.WindowsService1.Default.Save();

        }

 

 

 

protected override void OnStart(string[] args)

        {

            // TODO: Add code here to start your service.

         

           // System.Diagnostics.EventLog.WriteEntry("Application","started 
");

           System.IO.StreamWriter fs= 
System.IO.File.CreateText(@"C:\ser.txt");

           fs.Write(global::WindowsService1.WindowsService1.Default.Setting1);

           fs.Flush();

           fs.Close();

        }
Date:Wed, 22 Aug 2007 23:34:01 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us