Windows Service Configuration File

Windows Service Configuration File 5,0/5 9622 votes

Jan 09, 2018  Web config file location Windows Server Please use technology-specific Windows Server forums for areas like File Server and Storage, High Availability (Clustering), Directory Services, etc. Configuring the properties of a Windows Service using command prompt and scripting it in a batch file is really simple and can save you from performing the same manual configuration again and again. The sc utility comes handy to achieve this. In the example below, we are going to configure a windows service to: Set.

Active5 years, 6 months ago
  • This article's sole purpose is to provide information regarding the services that your Windows VPS may utilize. Below, you will find the services' configuration and log file locations, which may be useful in troubleshooting errors on your VPS.
  • Additionally, you must package a copy of the service configuration file along with the service assembly and any dependent DLLs that you deploy to the Windows Azure storage account. Note: To change service configuration settings, you only need to update the on-premises copy of the service configuration file.

I'm currently developing a basic windows service with a configuration file (servicename.exe.config), the default configuration file you access in a Visual Studio project properties. This service installs and runs correctly, however I am unable to find the configuration file of the installed service.

Read/Write code snippet:

Project settings image:

  • The service is running under the local system account
  • When stopping the service, changing a setting in the servicename.exe.config (next to the executable) and starting the service does not change the setting (proving its not pulling the settings from this config file)
  • When altering a setting in the service code, stopping and starting the service, the setting has the updated value from the previous run (proving it is being saved somewhere)
  • AppDomain.CurrentDomain.SetupInformation.ConfigurationFile points to the above config file

I have looked in the sub-directories of AppData in the default and public user accounts, I have also looked in C:Windowssystem32configsystemprofileAppData

Any help would be appreciated :)

EDIT: Added code snippet of save/read

m.t.bennett
m.t.bennettm.t.bennett

2 Answers

You are using user settings. These settings are not stored in servicename.exe.config next to the executable. I found this article at MSDN. It describes where user.config is stored and how to get the file path of that config.

Phonerescue keygen torrent. Jul 23, 2019  PhoneRescue 3.7.2 Crack 2019 Serial Key Number incl Patch iOS-Android PhoneRescue 3.7.2 Full Crack Keygen puts the emphasis on data recovery functionality and offers said functionality to all the iPhone users out there. Aug 11, 2019  PhoneRescue 3.7.2 Full Crack with Patch Free Torrent Multilingual. PhoneRescue full 3.7.2 crack is a superb data recovery tool that helps to recover the lost or deleted data for your devices like iOS without any hindrances. With this app, no data loss will be encountered while requiring the files. Dec 13, 2018  PhoneRescue 3.7.2 Crack Free Activation For Lifetime! Moreover, PhoneRescue 3.7.2 Crack comes in the market with its latest features now. The latest features are so powerful to work. So, they are also organized, that is why it is a very famous and likable tool among the users.

Personally I don't think that using user settings is a good choice for windows service which by default runs under local system account (if not set differently). I would suggest to use a local file database (i.e. sqlite or Sqlserver CE etc.) for these settings.

pepopepo
6,7112 gold badges19 silver badges36 bronze badges

There should be a web.config file after install, if you installed it correctly on your system.
An installed service should not be in C:Windowssystem32.. it should be in C:inetpubwwwroot

Mike WeberMike Weber

Not the answer you're looking for? Browse other questions tagged c#windows-services or ask your own question.

Configuring the properties of a Windows Service using command prompt and scripting it in a batch file is really simple and can save you from performing the same manual configuration again and again.

The sc utility comes handy to achieve this.

In the example below, we are going to configure a windows service to:

  • Set the startup type as automatic.
  • Run the service under a particular account
  • Set the failure actions for the service and set the reset period.
  • Define dependencies.

To give a more clear understanding, screenshots of the service properties UI is attached along with the scripts to set the configurations.

Windows

1. Set the startup type as automatic.

sc config 'Service1' start= auto

Note here that although the Display name of the Service is myfirstservice, The actual Service name is Service1. We need to use the actual service name in the scripts to control the service properties.

2. Run the service under a particular account

sc config 'Service1' obj= mydomainsidharth password= MyPassword

3.Set the failure actions for the service and set the reset period.

sc failure 'Service1' actions= restart/180000/restart/180000/'/180000 reset= 86400

The restart service times are in milliseconds and the reset fail count time is in seconds.

4. Define dependencies.

Our service depends on the SQL Server service, whose Actual Service name is MSSQLServer, To set this dependency, use the following command.

sc config 'Service1' depend= 'MSSQLServer'

Finally, to start the server use

net start Service1

Windows Service Config File Not Found

We can also club all the command and save it as a batch file, it will look like this:

Windows Service Configuration File Windows 7

sc config 'Service1' start= auto
sc config 'Service1' obj= mydomainsidharth password= MyPassword
sc failure 'Service1' actions= restart/180000/restart/180000/'/180000 reset= 86400
sc config 'Service1' depend= 'MSSQLServer'
net start Service1

Nike vrs covert driver settings. Nike goes their own way by ditching the trendy matte black, gray and white in favor of shiny, durable chrome. Not as effective for slow swing speeds. Sunken cavity can lead to distance loss on mis-hitsNike’s not shy on the course in general and the precision Nike VRS Covert 2.0 Irons are no exception. KEY FEATURES. These cavity-back clubs have a simple, beveled design which strives for a balance between aggression and softness.Does their eye-catching design mean technical precision, or is this club all flash with no substance?