windows-services

Is it possible to use Windows 7 Task scheduler in own application

I'm developing add-on based application. Every add-on use scheduler. Loaded add-on schedule task. My application run only one instance. Sometimes application closed, sometimes running. Therefore i need to use Windows 7 Task scheduler How to use task scheduler on own application? I need create new task from application I need that when ...

Solution to run a .NET component on regular intervals in Windows

I need to write some .NET code that runs on a regular interval to check for "unprocessed" items in a table in the database, processes them, and then writes back to the database that they are processed. We'll probably set it up to run every minute. How can I set up in the component in a Windows Server environment so that the code execut...

Check Service is running from a DLL

I have registered a COM Context menu DLL (to display Explorer Context Menus) in a Windows7 machine. In the DLL, I have checked whether a service is running in my system. The service is running under 'Local System Account'. I have checked the service status by OpenSCManager and QueryServiceStatus. It seems to work in XP without any issu...

System.Web Reference in Windows Service in .NET 4.0

Hello I have two project in a .NET 4.0 framework visual studio solution. First is a Class Library and second is a windows service. In My Class Library I am using HTMLEncode and HTMLDecode functions so I referenced system.web.dll in my class library project. But when i referenced my class library in windows service it's not referencing ...

Using MSDeploy to install windows services from package

I've read where it's possible to utilize MSDeploy to install windows services or even performance counters on a remote machine. I see how this can be accomplished using the MSDeploy "sync" from a source directory to a destination directory. Is there some way of actually having the source be the binaries contained within the .zip file i...

Calling custom methods on windows service

Hi, How can i call custom method on a windows service: public class TestService:ServiceBase { public TestService() { // constructor } protected override void OnStart(string[] args) { // do some work here } protected override void OnStop() { // do some work here } public void TestMethod(int arg) { ...

Does Windows service needs to be rebuild after changing config file?

I changed config file of the windows many times. Before changing config file I stopped the service and after changing config file, started again. Every thing worked fine. But last time when I made some changes in config file of the windows service and started it - It didnt worked, I even tried reinstalling the service but in vain. As ...

Installing Windows services gives an error

Hi, I created a simple windows service on my local PC and added the following code to it Protected Overrides Sub OnStart(ByVal args() As String) Const iTIME_INTERVAL As Integer = 60000 ' 60 seconds. Dim oTimer As System.Threading.Timer System.IO.File.AppendAllText("C:\AuthorLog.txt", _ "AuthorLogService has...

Calling CoCreateInstance during service startup

I have a windows service, that makes several COM+ calls during initialization. On some systems this windows service causes a deadlock during startup. At least one service or driver failed during system startup The problem with calling CoCreateInstance during service startup is that it might require other services to startup. And th...

Why does System.Windows.Forms.HtmlDocument require full trust?

The HtmlDocument class has the following attribute: [PermissionSet(SecurityAction.LinkDemand, Name="FullTrust")] public sealed class HtmlDocument Why? Can I override this somehow? Or would i need to reflect the source and recompile? ...

Opening a MS Word document in a windows service seems to hang

Hi I have a windows service written in c# which reads the text from word documents (doc and docx) using VBA interop. However on certain documents it seems to hang on the call to the Open method. It seems that the problem documents all have macros in them. The locally installed version of word has macros disabled and the code I use to op...

checking the state of a window service through Java

hello all, I am looking for a way to check the state of a windows service through Java. From some basic search through Google and here it sounds like Java has no api to query the Windows Services. On the Windows command prompt running: sc \some_host_name query "serviceName" gets me the info i want. Now i want to be able to run that in...

C# Windows Service latest technology

All, I have been writting Windows Services for a while in C# deriving from ServiceBase. So far my services are hosted in servers where they usually listen to message queues and process messages. Is there a new way of creating such services in WCF ? Thanks, MK ...

Should I block even when I'm sequentially processing

I have a windows service that periodically needs to do some work. So I set up a System.Timers.Timer to do this. Lets assume that its possible that the processing time could be greater than the timer interval. Lets also assume it would be a very bad thing if this happens. To avoid this I'm setting the AutoReset on the Timer to false and...

Windows Service doesn't start automatically

I have a windows service written in .Net 3.5 set to be automatically start, but it wouldn't start when system reboots. As I understand, it may be caused by my service's dependency aren't started when the services tries to start. I don't know what my service depends on. I tried the workaround by adding windows print spooler as one of my...

Best Practice for storing settings for a .NET Windows Service: Service Property Settings, Serialization, ...

I am working on a .NET Windows Service where I am trying to store settings that will be used when the service is started and while it is running. I have searched through posts on SO and found that using the Settings in the properties of the project is great for use with console and winforms applications. However, Google and SO are sile...

Install/Uninstall a Windows Service in a build script with NAnt

Does NAnt have the ability to install or uninstall a windows service, using the InstallUtil utility or whatever else? ...

Is there a way to configure Log4Net to write the logs to the BaseDirectory in a Windows Service?

Logs in a Windows Service are not written to the path of the exe because the windows service is started in another directory. What's the best way to write the logs to the AppDomain.CurrentDomain.BaseDirectory? This is my appender: <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender"> <!--<file value="Logs/...

Is it possible to install a Windows Service on a remote machine with an ant script (or dos command)?

I'm looking to easily install a windows service on a remote server. Now, our ant scripts upgrade a database (exe program) and deploy the webserver files on a remote server (ftp). Would it be possible to automate installation and upgrade of a windows service? ...

How to let Timer skip tick if the previous thread is still busy

Hey, I created a windows service, that is supposed to check a certain table in the db for new rows every 60 seconds. For every new row that was added, I need to do some heavy processing on the server that could sometimes take more than 60 seconds. I created a Timer object in my service, that ticks every 60 seconds and invokes the wante...