473,769 Members | 2,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to change application scoped settings programmaticall y

Hello all,

I have this problem.
I have a windows service and I would like to put there Settings for starting
this service. Because of this service is running under NETWORK_SERVICE
account, what is the best way to use settings? Should I create my own
settings or can I use classic application settings. Is there way to change
this application-scoped settings change programmaticall y?

Thanks.
Apr 27 '06 #1
3 4940
Hi Mirek,
Should I create my own settings or can I use classic application
settings. Is there way to change this application-scoped settings
change programmaticall y?


Unlike the user-scoped settings, the framework doesn't provide a method to
change application-scoped settings in the run-time, and the
application-scoped settings are read-only in most cases. So I suggest you
can create your own settings in a plain xml file and put it in the same
directory (or a well-known path) with your service's image, then manipulate
that xml file in your service's application to read and edit those settings.

Thanks for your understanding.

Best regards,

Gary Chang
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Apr 28 '06 #2
Thanks, I thought so,
thanks for confirmation. Now, is my soul a little bit calmed. :)

Mirek :))
""Gary Chang[MSFT]"" <v-******@online.m icrosoft.com> wrote in message
news:wg******** *****@TK2MSFTNG XA01.phx.gbl...
Hi Mirek,
Should I create my own settings or can I use classic application
settings. Is there way to change this application-scoped settings
change programmaticall y?


Unlike the user-scoped settings, the framework doesn't provide a method to
change application-scoped settings in the run-time, and the
application-scoped settings are read-only in most cases. So I suggest you
can create your own settings in a plain xml file and put it in the same
directory (or a well-known path) with your service's image, then
manipulate
that xml file in your service's application to read and edit those
settings.

Thanks for your understanding.

Best regards,

Gary Chang
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no
rights.

May 10 '06 #3
You are welcome, Mirek.:)

Good Luck!

Best regards,

Gary Chang
Microsoft Online Community Support
=============== =============== =============== =====
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

May 10 '06 #4

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

Similar topics

20
4496
by: J-T | last post by:
We are working on an asp.net application which is a 3-tier application.I was aksed to create a component which monitors a folder and gets the file and pass them to a class library in our business logic layer(so far so good and easy).I initialize my class which is using a FileSystemWatcher in my Global.asax and everything works fine.I have found FileSystemWatcher class not very reliable and sometimes it behavies unexpectedly.I'm afriad that...
9
2554
by: Dave Booker | last post by:
When I run a particular application I've been working on for a while, it somehow finds a value for the Application Setting "Test.Properties.Settings.Default.ProjectPath", but I can't see where it is acquiring the value! I have been through all of the project's Properties, and read through every app.config on my entire computer and can't find the value it's getting during runtime. Mysteriously, when I step through the application in...
3
338
by: John | last post by:
Hi For my db app, I need to save the location of the db (really a windows path) which normally only needs to be set at the first app start (I can check if the setting is missing and ask user for a value). Occasionally (once in a blue moon) I may need to change this setting in case db is moved to a different server etc. My question is what sort of mechanism can/should I use to store this setting?
3
4794
by: xycos | last post by:
Hello. I apologize for asking this question as the information I need is availible via the MSDN library, however I cannot seemt o understand what I need to do, so I'm asking here. I have created application settings in Visual Studio (right-click on the project, go to the settings tab, etc.) and have associated each of these settings with a property on a form. This seems to be working right (i.e. if I edit the default value of a setting,...
6
7532
by: Steve Kershaw | last post by:
I have a problem in which I'm trying to access a method in a .DLL from an ASP.Net web page (written in C#). I keep on getting the error "The current configuration system does not support user-scoped settings". I've done some research into this problem and I've found out that the solution has something to do with the ConfigurationManager.AppSettings for settings, or Profiles for per-user configutation in ASP.Net 2.0. However, I don't know...
0
1085
by: SteveKershaw | last post by:
I have a problem in which I'm trying to access a method in a .DLL from an ASP.Net web page (written in C#). I keep on getting the error "The current configuration system does not support user-scoped settings". Here is my code snippit from the .master.cs file: protected void btnProcessFlatFile_Click(object sender, EventArgs e) { try { PayrollTaxesMaster.PayrollTaxesMasterClass objPayrollTaxesMaster;
2
1700
by: Chris Dunaway | last post by:
What what I have read, Application Scoped settings in the setting file are read only. Why is this? Is there a good reason for this restriction? I understand that some settings will be different for each user of the app, hence the User Scoped settings. User scoped settings can be changed and persisted at runtime. But there are also settings that are not User Scoped (i. e. Application Scoped) that still might need to be changed at...
6
15310
by: Andrew Jocelyn | last post by:
Hi How do I programmatically change (read/write) the values in this app.config file at runtime? Specifically I want to change the client endpoint address but it would be nice to change other values too. I thought this is what ServiceHost is for but is seems way more complicated to use for what I'm trying to do. <system.serviceModel> <bindings>
2
4042
by: shujaat | last post by:
Hi, I'm working on a Windows Service (C#) and have added a few Application scope settings in it. Since application-scoped setting are read-only, I have manually added "set" functions for each of them in the designer-generated code. Now I can assign value to these settings at run-time and call the Save function without any exceptions, but this doesn't actually save them to the disk file. Whenever my service restarts, i find that it is still...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10222
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10050
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9866
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8876
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5310
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3570
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.