Click here to Skip to main content
15,881,812 members
Everything / Service

Service

service

Great Reads

by Safak Tarazan
Usage of services, alarm manager and broadcast receivers
by Michael Haephrati
Windows Services are powerful little beasts and encountering them is unavoidable when developing under Windows
by wayvirgo
How to use the Google Calendar API from VB.NET.
by honey the codewitch
Add the ability to run a service in console mode and to control or install your service from the command line

Latest Articles

by Michael Haephrati
Windows Services are powerful little beasts and encountering them is unavoidable when developing under Windows
by Hugo G Fernandez R
In this article, I will explain and show step by step how to implement through the swashbuckle library a good and useful documentation for your RESTful APIs created under the ASP.
by Michael Haephrati
An up to date article about NT Services
by honey the codewitch
Add the ability to run a service in console mode and to control or install your service from the command line

All Articles

Sort by Score

Service 

13 Mar 2019 by Safak Tarazan
Usage of services, alarm manager and broadcast receivers
14 Feb 2024 by Michael Haephrati
Windows Services are powerful little beasts and encountering them is unavoidable when developing under Windows
1 Jan 2012 by wayvirgo
How to use the Google Calendar API from VB.NET.
23 Apr 2013 by Ian A Davidson
I am sorry that I only saw this question today. I have a several years' experience with FileSystemWatcher (and with the Win32 API functions when using C++ before C#).These are the main areas to look out for:1) As you said, make sure the code that handles notifications is as quick as...
14 Jan 2020 by honey the codewitch
Add the ability to run a service in console mode and to control or install your service from the command line
23 Dec 2011 by Dan Randolph
Builds on the existing RunRemote project to run commands on a remote server.
19 Dec 2014 by H0tHead
Using InstallUtil.exe from command line is so boring
31 Oct 2011 by Espen Harlinn
Take a look at this page:http://msdn.microsoft.com/en-us/library/50614e95(VS.80).aspx[^]installutil lets you install, and uninstall services - they have to run under the service control manager[^].I often find the convenient to test the implementation of a service using a win forms or...
22 Apr 2012 by ManojKumar19
How to make WCF service reference configurabe for Silverlight project(makes easy for deploying on severs like Dev, QA, UAT etc.)
7 Dec 2012 by Sharad.Patel
This is the batch files I used to install.@ECHO OFFREM The following directory is for .NET 2.0set DOTNETFX2=%SystemRoot%\Microsoft.NET\Framework\v2.0.50727set PATH=%PATH%;%DOTNETFX2%echo Installing MyService...echo...
3 Apr 2014 by Volynsky Alex
Let's see here:Access C# .net web service in android[^]Consuming C# web service with android application[^]Good luck Timir
5 Sep 2016 by PureNsanity
Architecture to support multiple transport and service bus technologies integrated to provide a unified messaging framework to communicate between any platform.
12 Nov 2010 by Electron Shepherd
What name are you using for the call to CreateFileMapping? Have you used the "Global\" prefix to force it into the global namespace?See also http://msdn.microsoft.com/en-us/library/aa382954.aspx[^] for a discussion about the SeCreateGlobalPrivilege that you will need.
16 Jun 2011 by Sergey Alexandrovich Kryukov
I have developed some approach related to it.First of all, Windows Service cannot have UI. It should keep working when a user logs off and when nobody has logged in. It does not mean that the same assembly cannot be used it two modes: interactive and Windows Service.I've created WPF...
25 Oct 2011 by KeithAMS
I am writing a service at present and have written a few over the years. What I do now is put all the code in a separate DLL from the start off. My service methods Onstart, OnStop call into the DLL which starts a thread to do the work.For debugging, I have a separate test harness console app...
29 Dec 2011 by Weidong Shen
This article describes the IClientChangeTracking interface generated by Self-Tracking Entity Generator for WPF/Silverlight.
1 Mar 2012 by Sergey Alexandrovich Kryukov
I hope you know that the services can be started automatically on system start-up, this is one of the standard options of the service installation which can be changed at any time using the Service Controller or services applet:%windir%\system32\services.mscSo, if the host running the...
31 Jul 2012 by Christian Amado
A very brief article about the implementation of encryption and decryption of a string in Silverlight Business Application
16 Feb 2016 by Andy South
We have established a goal to decide, what solution (as in a combination of software and services) among those we chose allows extending the audience of an event with minimum efforts.
27 Dec 2010 by W4Rl0CK47
I have a WCF service self-hosted in a console application. (will later moved to a WPF app)It works all fine when the windows firewall is turned off. But when the firewall is active, service doesn't seems to receive ANY requests.Service opens fine.I'm using basicHttpBinding and no...
31 Oct 2011 by Mehdi Gholam
To debug a service add a delay in the OnStart method like Thread.Sleep(10000);.Then you have to attach your debugger to that process http://msdn.microsoft.com/en-us/library/c6wf8e4z.aspx[^].
15 Nov 2011 by TRK3
Here's a great blog covering threading issues with WCF callbacks:http://www.dotnetdude.com/2010/08/20/DealingWithThreadingWhenUsingWCFCallbacks.aspx[^]In a nutshell, by default the callback to your client is made on the UI thread. That can end up causing various deadlock...
6 Apr 2013 by Modesty Zhang
Running pdf2json module in RESTful Web Service, built with resitify and nodejs
19 Nov 2013 by Sergey Alexandrovich Kryukov
Thank you for confirming my guess: you want to create some UI to show progress in the service operation. As Ron correctly pointed out in his Solution 1, you cannot have UI in your service application, as it is non-interactive, but quite a good reason: when a user logs off, your service...
25 Feb 2014 by Mantri Vishal
How to creating table in Azure Mobile Services using Azure Service Management Rest API
4 Feb 2015 by Zoltán Zörgő
There are several JSON (de)serializers you can use. Like fastJSON[^] or Json.NET[^] you can use to deserialize your json string into known or dynamic object.
29 Oct 2015 by phil.o
A Windows service has no application message pump, thus it is unable to display whatever graphical UI.So a service does not seem to be the solution here.You have several choices:- you keep your UI but won't be able to run it as service.- you throw the UI away, only keeping the...
1 Aug 2016 by Dave Kreskowiak
YES, it's bad practice. Normally you would create a user account for the service to run under and modify the account appropriately for your services requirements and give it only the minimum permissions it needs to do its job.This cuts down on the attack surface of your service and cuts down...
2 Jan 2017 by Ashwin. Shetty
Assumption: Service 1 and Service 2 are two different processes running as windows serviceAnswer: You will not be able to call this method by reference because two different services will have its own memory allocation and execution. If you are not interested in sharing service memory and...
27 Jan 2021 by Wendelius
One possible reason is that the DSN you have used (TEST) is defined only for the user (you), not as system DSN. So if you're running the service under different user account, it cannot see the DSN. In ODBC admin tool, try defining the data...
12 Nov 2010 by Electron Shepherd
The other thing I suspect you would need to do, if you wanted to use memory-mapped files, would be to call CreateFileMapping with a NULL DACL for the security attributes (not the same as passing NULL in as the parameter value).
3 Dec 2010 by compninja25
Well, I changed the process over to fire up Foxit Reader and it worked like a champ! I guess it was just something that Adobe doesn't like?Oh well...at least it's working! whew!For anyone else that might run into this issue, it's a windows service that is installed with my local user...
4 Dec 2010 by Dave Kreskowiak
You cannot use the Local System account for your application. Lcaol System only has permissions to that system, nothing else. If your app is looking at each system to collect data, it'll have to run under and account that has permissions to get to that data on every machine. System and Local...
19 Dec 2010 by #realJSOP
If you don't trust your admins, fire them, and then hire someone that you do trust. We won't help you write a virus - EVER.If you write a service that logs when it's been stopped, and by whom, you can at least detect and eliminate the threat without having to "write a virus".
27 Dec 2010 by W4Rl0CK47
Found a solution for this.I've searched through a lot of sites, including codeplex, but couldn't find a good solution in managed code.Most solutions were calling native code in protected locations, which can be blocked by UAC and some anti-virus programs. Some of them used COM components...
8 Apr 2011 by Nish Nishant
It's quite likely that you are missing an assembly reference to System.ServiceProcess.dll.
25 Apr 2011 by Gil Fink
A simple solution for using lambda extensions instead of strings while configuring a WCF Data Service
29 Apr 2011 by #realJSOP
No. If an application requires an interface, you can't open it from a Windows service (at least not in Vista/Windows 7). In XP (and earlier), you can set the service to "interact with the desktop", and even then, that will only work when a user is logged in.
29 Apr 2011 by Manfred Rudolf Bihy
Even if it were possible to open a window from a windows service, please heed my advice:Don't do it!Don't even think about doing it.A windows service can always run even when no user is logged into the system. So what use is it to open a window when nobody is logged on to see it.Do...
16 Jun 2011 by #realJSOP
A service can't have a UI. You have to do like SA said - create a separate app (that lives in the system tray) that can communicate with and control the service.
5 Aug 2011 by thatraja
Already answered a similar question few months ago, see thatWhere to store 1 billion records[^]Sql Bulk Insert/Update[^]Running millions of inserts.[^]ADO.NET and OPENXML to Perform Bulk Database Operations[^]You can find more in CP & Google
2 Sep 2011 by Mehdi Gholam
MS Sync framework has samples for this usecase, check the samples first, as it is ready to go as is.
25 Oct 2011 by jim lahey
Along similar lines to KeithAMS, when writing a Windows service, I only use the Windows Service Project as a container to run code that is in one or more referenced assemblies. As far as I'm concerned, if I've got any logic that goes beyond starting and stopping the service in my service...
31 Oct 2011 by Sergey Alexandrovich Kryukov
I used alternative approach: developing of the application which can be run in both modes: as a windows service and as an interactive application. The application can detect during runtime how it is currently hosted and behave slightly differently. In interactive mode, it can do a lot more, for...
28 Nov 2011 by DaveAuld
Your while (true) will be running in a loop constantly until the time is 12:00, one dirty method could be to check how far you are away from the trigger time and go to sleep for 5 minutes or something. Although it would not be a recommended solution.One other solution would be to write your...
11 Dec 2011 by Monjurul Habib
Following links will help you:Implement CRUD Operations using RESTful WCF Service and JavaScriptDatabase CRUD Operations In Business Sites With WCF REST, Web Services As Provider And JQuery, Javascript As Consumer : Zero PostbackHow to do CRUD operation in asp.net using WCF?Step by...
28 Dec 2011 by #realJSOP
You can't really integrate a Windows service with a web page, but using a database to specify the data used by the service is certainly viable, and is the way i would do it.
21 Jan 2012 by Weidong Shen
This article describes how to do data validation with Self-Tracking Entity Generator for WPF/Silverlight.
6 Apr 2012 by Shahin Khorshidnia
Protected Overrides Function GetWebRequest(uri As Uri) As WebRequest Dim myWebRequest As HttpWebRequest = DirectCast(MyBase.GetWebRequest(uri), HttpWebRequest) myWebRequest.KeepAlive = False Return myWebRequest End FunctionAnd Look at this:...
18 May 2012 by Stephen Hewison
My best guess would be that you're using windows authentication to connect to SQL?If this is the case, you need to make sure the user under which the service is running has permissions within SQL. If you look in System, Administrative Tools, Services and find your service. You can...
9 Jul 2012 by Jackie00100
okay fixed this my self after finding the right imports...EDIT:Source code:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using...
20 Jul 2012 by barneyman
80080005 is a server faultThis[^] may be of some use
26 Jul 2012 by John Orendt
Visits to configured web sites in every configured interval and logs connectivity.
11 Sep 2012 by Mohamed Mitwalli
Hi ,Check this Walk through windows services...
28 Oct 2012 by Sergey Alexandrovich Kryukov
You can, but also you can use the service which already exists, called Windows Task Scheduler, see:http://en.wikipedia.org/wiki/Task_Scheduler[^],http://msdn.microsoft.com/en-us/library/aa383614.aspx[^],http://msdn.microsoft.com/en-us/library/aa384006%28v=VS.85%29.aspx[^].See the last...
28 Oct 2012 by Sushil Mate
I guess Windows_Task_Scheduler[^] will serve the purpose.
18 Dec 2012 by Thomas Daniels
Hi,Have a look here:http://weblogs.asp.net/kaushal/archive/2011/02/28/start-stop-window-service-from-asp-net-page.aspx[^]http://forums.asp.net/t/1062574.aspx/1[^]
18 Dec 2012 by sisir patro
HI,Check out some more links these may help you too.How to Start/Stop a Windows Service from an ASP.NET app - Security issuesStopping windows service from asp.net application on Windows 7how-to-start-or-stop-a-windows-service-using-C-SharpHow to stop Windows service C#Thanks
25 Mar 2013 by Jochen Arndt
See the EnumServicesStatusEx[^] API function.
25 Mar 2013 by Maxim Kartavenkov
That is very easy, you just need to use 2 WinAPI: OpenSCManager and EnumServicesStatus. First one is used to obtain service control manager handle, and the second one to enumerate services based on given status and type.Regards,Maxim.
9 Apr 2013 by Sergey Alexandrovich Kryukov
This is not really a "solution", but something you should better be aware of; please see these CodeProject articles:FileSystemWatcher - Pure Chaos (Part 1 of 2)[^],FileSystemWatcher - Pure Chaos (Part 2 of 2)[^].—SA
28 Apr 2013 by Prasad Khandekar
Hello,Download & Install Oracle Data Provider for Net[^]. Use code similar to one shown below to connect to Oracle & Retrieve the data.string strPass;string strCon = "USER_NAME/PASSWORD@//DB_SERVER_HOST_OR_IP:PORT/SERVICE_NAME";using (OracleConnection conn = new...
21 Jun 2013 by Krishna KV
I have deployed a WCF URL in IIS, the URL is public. I don't want to list all method available in WebService for all users. How to implement the Client Certificate for the authentication, based on the authentication type it should list the methods. Regards,Krishna
23 Oct 2013 by OriginalGriff
We do not support, condone or assist in the production, distribution or otherwise of any form of malware. Please disable your firewall, turn off your antivirus and follow some google links to hacking sites. Have your credit card ready.
18 Nov 2013 by Sergey Alexandrovich Kryukov
You have only one problem: you probably think that architecture is drawing boxes, clouds and connecting lines, with some captions. It is not. Architecture is fist of all some thinking. And this is something which you pretty much missed.Let's start from the second picture, because this is the...
1 May 2014 by Sergey Alexandrovich Kryukov
Before learning .NET serialization, you need to learn what it means and what are the general purposes: http://en.wikipedia.org/wiki/Serialization[^].If you still cannot understand the purpose, think about this: during runtime, you create and modify certain objects in memory. What happens to...
20 Jun 2014 by Richard Deeming
Rather that writing this as a Windows Service, write it as a standalone application and use the built-in Task Scheduler to schedule it to run every hour:http://windows.microsoft.com/en-gb/windows/schedule-task[^]
10 Sep 2014 by Raul Iloc
1.The first solution, related wit the debugging of any Widnows Service aaplication, is to attach your project from Visual Studio to the to the installed process. You can see details here:http://msdn.microsoft.com/en-us/library/7a50syb3(v=vs.110).aspx[^]2. Because in fact you want to test...
10 Sep 2014 by Sergey Alexandrovich Kryukov
Please see my past answer where I suggest different approaches: Configure Windows Service with UI[^].—SA
11 Apr 2015 by Sergey Alexandrovich Kryukov
You are badly misusing the event wait handle objects. These events are used only to notify the thread in a wait state, to wake it up. Actually, this is not an "event" in the sense of something you can "send" and "receive", this is a way to throttle execution of some thread without any waste of...
30 Jun 2015 by Dave Kreskowiak
The variable you're using to hold your List collection is Nothing (null).When you declared it like this: Dim ptsid As List(Of String)you only said that the variable ptsid CAN hold a List(Of String). You didn't actually create the List.Change that to Dim ptsid As New List(Of...
19 Aug 2015 by OriginalGriff
Basically, you can't - unless there is an inheritance relationship between the two classes, (i.e. one derives from the other, or they both inherit from the same base class), or you explicitly provide a cast method from one to the other, the system can't do it.This may help:...
17 Jul 2016 by Andy Point
Android Download Manager Tutorial: How to download files using Download Manager from the Internet
1 Aug 2016 by José Amílcar Casimiro
The IT department does not like because local administration permissions allow your service to do anything, and they probably will not look at the code. If your service has a single point of failure, the machine can be compromised.What is the real need to have a windows service with...
10 Oct 2019 by sopy7
I have created Windows Service in Visual Studio 2015 (Professional), .NET version: 4.5.2But I am not able to install this windows service on my machine.Followed below mentioned steps to install Windows Service1. Start >> All Programs >> Visual Studio 2015 >> Visual Studio Tools >>...
16 Nov 2016 by Midi_Mick
The lines that will be chewing up your CPU arewhile (ExecuteTime()){BasicBO.ComputeData();}That is a very tight loop, with no breathing space for the CPU in there. Pop a Sleep in that loop, and I think your problem will go away.Either that, or perhaps you meant if rather than...
18 Nov 2016 by johannesnestler
Hi manish_rccplease have a look at the modified Code and the comments:public partial class Service1 : ServiceBase {// 1. Timer not static - one instance per Service... Timer timer;// Configuration can be cached TimeSpan startingTime; TimeSpan...
16 Mar 2017 by johannesnestler
other's comments are good and right. i just wan't to share the approach I use when developing Windows Services.I don't want to unistall/install Service for a quick test during debug so I run them as console-applications.So I use Environment.UserInteractive to check if I run from...
16 Nov 2017 by OriginalGriff
Technically, no - a windows service has - and can have - no user interface at all, so even the console is out of bounds. But ... depending on what your app does, and what use it makes of the console it should be possible to rewrite it to be a service. How difficult that process is will depend...
4 Jul 2018 by Sudhakar_Bandi
How to host ASP.NET Web API to Azure Service Fabric using containers
23 May 2019 by maj000
When creating your FileStream you should be using FileMode.Open and not FileMode.Create, i.e. FileStream fs = new FileStream(@"" + offlinePath, FileMode.Open); Using FileMode.Create will create a new file (overwriting the file if it already exists) while FileMode.Open is used to open an existing...
11 Jun 2019 by Michael Haephrati
Since Windows 7, security of Windows Services has been strengthened. Services now run isolated in Session 0, so there can be no interaction between the user (typically session 1, 2, 3, etc.) with Windows Services. See: this article[^] I read an old article which yet addresses this new change...
9 Jun 2019 by Michael Haephrati
I managed to find the reason for this problem and solve it. The source code was OK as it is. I did everything right, as I looked over all sessions to use a token from the first user logged on and running the child process with the UI on this session. For some reason, it didn't work because I...
29 Jul 2019 by Dave Kreskowiak
Your question makes no sense. Web App? Console App? Windows Service app? You didn't do a very good job of explaining what app is running where and how these apps relate to each other. What are these apps doing? How does this "Print button" work? What is the code behind it? "Default Printer" is...
19 Aug 2019 by OriginalGriff
Windows services cannot have a user interface, nor can they start or run any application which does have a user interface - because a user interface requires a user to be logged in, and services can run without a user (because they don't run under the user account; they can be run when the OS...
29 Jan 2022 by Patrice T
Quote: Note: I am disposing all the objects once used The memory usage is the proof that you are wrong. Quote: Can anybody suggest me the solution to fix that? The problem being something wrong in your code, the solution is applying specific...
25 Mar 2024 by OriginalGriff
Without your service (and probably your actual PC) we can't really tell what is going on - so I'd start by adding logging to the service and reinstall - that way, you should at least be able to tell if the system is trying to start it, and if it...
26 Mar 2024 by Dave Kreskowiak
Open the machines Event Log Viewer and look in the Application event log for any error messages concerning your service. Without more information and what your code does at startup, and your code, it's impossible for anyone to tell you what's...
25 Aug 2010 by anand kr
How to use Spring Integration with ActiveMQ to handle message in pure POJO
26 Aug 2010 by R. Giskard Reventlov
This forum is for programming questions; in other words you have some code with which you are having a problem and you come here for help. Asking a very broad question about a non-programming subject could get you uni-voted mercilessly.
26 Aug 2010 by Richard MacCutchan
This[^] is where to look.
25 Aug 2010 by Alice88
people who looking for a taobao agent,can seek this website:www.taobaomaster.com.Taobaomaster, a professional online purchasing agent, is committed to assisting people both out of and in China to buy their interested items on taobao , or on other famous Chinese shopping websites. Many years of...
27 Sep 2010 by Frozen Rain
There is a simple way to consume WCF from clients which do not support Microsoft's SOAP implementation. It is achieved by using REST to accept data and convert REST calls to SOAP calls with the PHP Framework.
11 Oct 2010 by TheIdleProgrammer
Hi guys,I am faced with a WCF security scenario that isn't particularly well documented online. I am developing a product licensing service in WCF that will be deployed along with our software. This licensing service will be responsible for a number of things related to controlling use of...
12 Nov 2010 by chiselca
Sauro, from what I have read, what you say is TRUE for memory mapped files AND shared data segments. Correct? MSDN Article on Shared Memory[^]
18 Nov 2010 by ShashankSinghThakur
mike,if endpoint is no declared how can host the service in IIS Server
27 Nov 2010 by #realJSOP
Googling this phrase - "deploy java servlet" - revelaed 500,000 hits, and the very first one has the title "Introduction to Java Servlets, Developing your first Java Servlet".Seriously dude - this is the internet, any question you might come up with has almost always been asked/answered...
11 Jan 2011 by Martin Schmidt
I have the same problem.The SNMP service and my application use an extension dll that has a shared memory area defined by "#pragma data_seg ...". This works perfectly under XP but not under Windows 7. The session ids are different like described in the first posting.Has someone some more...