Menu
  • HOME
  • TAGS

Same system, same code, different behaviors: The request was aborted: Could not create SSL/TLS secure channel

c#,wcf,ssl,windows-services,windows-applications

I found Windows Service's permission settings in Properties window's Log On tab, changed account from Local System to My User Account (Logged In User) and it works like a charm.

Calling website through Windows Service

c#,asp.net,windows,service,windows-services

Yes, the HttpWebRequest class is what you need.

How do I stop a Windows Service when it has completed?

c#,windows-services

You don't have to start and stop the service. Use a Timer. Set its interval to one hour and execute your process in timer elapsed event. Define a class level Timer object. Instantiate it in OnStart and enable it. In the Elapsed event execute your process, something like: private System.Timers.Timer...

Sceduling Java from a Web Service

java,windows,web-services,windows-services,job-scheduling

Executor For the periodic execution of the task in Java, learn about the ScheduledExecutorService. Search StackOverflow for many examples and discussion. besides that class, you will find much discussion about the Timer class. But Timer is older, less flexible, and most importantly, should not be used in a Servlet environment....

Best way to do a task looping in Windows Service

c#,multithreading,windows-services,task-parallel-library,async-await

You should have an async method that accepts a CancellationToken so it knows when to stop, calls ProccessSmsQueue in a try-catch block and uses Task.Delay to asynchronously wait until the next time it needs to run: public async Task DoWorkAsync(CancellationToken token) { while (true) { try { ProccessSmsQueue(); } catch...

Using ASP.NET Web application as SignalR client

asp.net,azure,windows-services,signalr

In Azure you cannot tell that your AppDomain will not recycle. Because of many reasons, it can restart itself to heal and then you will end up making a new connection to the SingleR server. Is that OK for you? Also SingleR is mostly used in the Web Functionality improvement...

WIX-Installer ServiceControl “sufficient privileges” error

c#,windows-services,wix,installer,visual-studio-2015

Correct, it's a generic error. You have to profile your service to understand why it won't start. GAC is just one scenario. In that case it's because MSI doesn't publish assemblies to the GAC until after StartServices. A classic race condition that results in a missing dependency and error. With...

quartz.config to read from sqlite file in the same directory

c#,sqlite,windows-services,quartz.net

You can configure the SQLite connection string to be app relative, see the answer here: App.config connection string relative path...

Alternate to run window service in Azure cloud

azure,windows-services,cloud,azure-webjobs

You've got 3 basic options: Windows service running on VM WebJob Cloud service There's a lot of information out there on the tradeoffs between these choices, but here's a brief summary. VM - Advantages: you can move your service basically as it is without having to change much or any...

System.ComponentModel.Win32Exception : Access is denied

c#,windows,permissions,windows-services,performancecounter

Services typically run as Network Service or Local System, unless you have configured them overwise. It sounds like you haven't changed the service logon user. You can do it from service control manager by right clicking the service and going to the Logon tab. Or you can do it from...

windows service access to network before logon

java,windows,windows-services,procrun

I just managed to solve this. The issue was that the service started before there was access to the internet. Keep in mind that the network might be accessible but the internet isn't. I solved it by doing: (pseudo code) while (false) { check if http://www.example.com is accesible: if true...

Silent install msi from a windows service local service account

c#,.net,windows-services,windows-installer,silent-installer

I don't think you have much chance of making this work. If the MSI tries to access folders like Desktop, User's Program Menu, the CommonFilesFolder (not a complete list) or looks at the LogonUser property and any number of other things it will fail because in a normal install from...

Windows service recovery - run a program wont work

batch-file,windows-services

The "run a program" recovery option for when a service crashes runs the specified executable in the same way as the service, i.e., it runs in session 0 (and so is affected by session 0 isolation, see also related questions) and it runs with the same security context as the...

is it possible to access outlook add in method from windows services

c#,windows-services,outlook-addin

No, Outlook Object Model (just like any other Office app) cannot be used from a service. You can use either Exchange Web Services (in case of an Exchange mailbox) Extended MAPI (C++ or Delphi only) Redemption - it wraps Extended MAPI and its RDO family of objects can be used...

Is it possible to send Windows Toast notifications from a c++ Windows service?

c++,windows,windows-services,toast

Yes it might be possible check this link Here Certain WinRT classes can be used from desktop apps, including portions of the Windows.UI namespace. The toast notification APIs are one such example - they can be used by both Windows Store apps and desktop apps

Can not overwrite file in virtual directory

asp.net,iis,windows-services,virtual-directory,shared-folders

So I've solved the problem. I have another service running on each server copying the images to a local folder instead of each server reading the images from the same shared folder. My guess is that the problem has something to do with the fact that an IIS website was...

Deploying/Installing Self Hosted SignalR Windows Service to Windows Server 2012

c#,windows-services,signalr,windows-server-2012

I don't think there is any kind of constraint about where to deploy your service, any directory will do. As for the rest, you can install it like this: installutil.exe SignalRService.exe and to start it you can use either the Services panel under the Administrative Tools, or the command line...

Call Soap Service From a Windows Service

c#,soap,windows-services

After digging one complete day,Today we contacted our Networks Department for this weird issue and we came to know that When we use Desktop Application to call any SOAP or WCF Service the request goes through Proxy Server, but in the case of Windows Service the request goes through System...

Start windows service on install without setup project

c#,visual-studio-2012,windows-services,setup-project,autostart

In your Installer class, add a handler for the AfterInstall event. You can then call the ServiceController in the event handler to start the service. public ServiceInstaller() { //... Installer code here this.AfterInstall += new InstallEventHandler(ServiceInstaller_AfterInstall); } void ServiceInstaller_AfterInstall(object sender, InstallEventArgs e) { using (ServiceController sc = new ServiceController(serviceInstaller.ServiceName)) {...

Can't start mongodb service

mongodb,windows-services

Check mongodb logs. In my case mongodb could not find directory from mongod.cfg

Create service with arguments using SC.exe

windows-services

According to this answer and the comments, the args parameter of OnStart is only used when manually setting start parameters in the windows service dialog, which cannot be saved. You can use the arguments you are setting up by accessing them in the Main method (located in the Service.Designer.vb file...

How does all this components work and communicate to each other?

asp.net,api,web-applications,dll,windows-services

A windows service is just an application that runs in the background inside Windows Operating Systems. You can view what services you have running by either going to your COntrol Panel -> Administrative Tools -> Services. These are just programs that you can write yourself. .NET provides an easy way...

Launch an exe application from windows service

c#,windows-services

Thanks for the answers! I found out a solution for it and im posting it here. I created a dummy app which is hidden on startup and it does the exact same function that the service was intended to. 1.create a dummy app (copy paste code from service to form...

How to run PostgreSQL as a service in windows?

java,postgresql,windows-services

Problem was solved path to the data directory was wrong in windows service file. So I delete the service file from this method: 1)Run Regedit or Regedt32. 2)Go to the registry entry "HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services" 3)Look for the postgreSQL service that you want delete and delete it. 4)reboot the computer. After that...

Create Glassfish windows service error

windows-services,glassfish

Ok! I had to delete the following files: java.exe, javaw.exe and javaws.exe from System32 in order to work. Its working fine now....

Creating a Custom Event Log (Security Error)

c#,security,windows-services,event-log

To create an event source you must have administrative privileges. All event logs, including the security log, must be searched to determine whether the event source is unique. Non administrative users do not have permission to access the security log therefore a SecurityException is thrown....

How to ensure ConfigurationManager points to correct App.config

c#,.net,windows-services

App.Config and other config files are read from the entry point of the program. Thus, if it is an application, the app.config file stored in the windows application project is read. LocalSqlServer is the default SQL server when no other connection string is defined. This is the reason why it...

Entity Framework 6: Unable to load the specified metadata resource

c#,entity-framework,configuration,windows-services,entity-framework-6

Why this happens? The issue you are having is just a result of extra security measures to prevent binary planting or DLL hi-jacking attack (read more) when running your application as as windows service. Why should I care? As you probably know, there is a specific, well documented order in...

Use of console.readline()

c#,windows-services

You could use a Timer to execute the logic periodically within windows service, protected override void OnStart(string[] args) { base.OnStart(args); Timer timer = new Timer(); timer.Interval = 30*1000; timer.Elapsed += new ElapsedEventHandler(timer_Elapsed); timer.Enabled = true; timer.Start(); } private void timer_Elapsed(object sender, ElapsedEventArgs e) { //put logic here that needs to...

Basic design pattern for using TPL inside windows service for C#

c#,multithreading,windows-services,task-parallel-library

Caveat here is not only how you start your worker, but also how you actually stop it. Beside Task itself, TPL also provides you with a very convenient way of task cancellation by using CancellationToken and CancellationTokenSource objects. Starting and stopping windows service with TPL To apply this technique to...

How to ignore nullable integers when converting from class to Xml

c#,.net,xml,wcf,windows-services

I assume you are using DataContractSerializer based on your use of DataContract and DataMember attributes. If you really want your integer properties not to be serialized "at all", no matter what their value is, just mark them with the [IgnoreDataMember] attribute: [IgnoreDataMember] public int? AttributeNotUsed2{ get; set; } Incidentally, when...

Can Windows Services with Admin User Account to start msiexec updating app for update an app

windows-services,windows-installer,updates,msiexec

In the right circumstances (signed MSI and MSP patch files) you don't even need to be admin to install a patch update, a non-admin can do it: https://msdn.microsoft.com/en-us/library/aa372388(v=vs.85).aspx...

How to check every 2 minutes for report checking in datagrid wpf?

c#,wpf,multithreading,windows-services,wpfdatagrid

If you need to get the data programmatically I would do something like this: async void Main() { Foo f = new Foo(); Task s = await f.Bar(); Console.WriteLine("Done"); } public class Foo { public Foo() { } //recursive tail function public async Task<Task> Bar() { //enter your code here...

Unable to access SQLite Database form windows services

c#,sqlite,windows-services

It doesn't matter what kind of application you are running in the windows service. The issue comes from the SQLite component. An unhandled exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll Additional information: Mixed mode assembly is built against version v2.0.50727 of the runtime and cannot be loaded in the 4.0...

VB6 - How do I open a file from an app running as a service

vb6,windows-services,shellexecute,createprocess,shellexecuteex

You cannot simply call Shellexecute() in the context of a process running as a service. Even if it succeeds (never really tested it), the launched app/document still wouldn't show on the desktop of the logged-on user because those are two different sessions, isolated from each other (unless you're on Windows...

Windows Service not starting on cold boot

.net,windows,visual-c++,windows-services

There could be a race condition during start up. If the Event Log has not started working before the system attempts to start your service, and there is a dependency on that log, this may cause your service to fail. Perhaps you can Change the order in which your service...

Exception HResult 0x800a03ec when trying to open Excel with Microsoft.Office.Interop.Excel.Workbooks.Open()

excel,wcf,windows-services,interop

The Exception was thrown upon opening the Document; on the machine which generated the Excels, the files were generated invalid. The solution was to change the Format of the numbers. Go into System Configuration -> Time, Language and Region -> Language Tap on the highlighted Hyperlink Open Advanced Settings Change...

Active Directory Acquiring Locked/Unlocked status in a Windows Service

c#,active-directory,windows-services,windows-server-2012-r2

I found out that when UserPrincipal object is used to get the lockout status of an account, the entire LDAP Path till the Organizational Unit(OU) in which the user is present should be provided as a parameter to the PrincipalContext along with the administrator login and password. For example: using...

C# check windows Service status

windows-services

Thanks to all anyway, I have used another way through WMI and it worked: ConnectionOptions op = new ConnectionOptions(); op.Username = ""; op.Password = ""; ManagementScope scope = new ManagementScope([email protected]"\root\cimv2", op); scope.Connect(); ManagementPath path = new ManagementPath("Win32_Service"); ManagementClass services = new ManagementClass(scope, path, null); foreach (ManagementObject service in services.GetInstances()) {...

Does a .NET service exhibit thread agility?

c#,.net,multithreading,windows-services

No. A windows service is not managed by the IIS pipeline and any threads that are created must be created by the service code itself.

MobileFirst Server 7.0.0 as service on Windows Server 2012 not recognizing runtime enviroments

windows-services,mobilefirst,websphere-liberty

Here's our complete solution: 1. Start CMD as administrator and run this: sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=delayed-auto 2. under Services.msc open the properties of the „IBM WebSphere Liberty V8.5 Worklight“ service and set this (if not already): Tab GENERAL -> Startup...

c# windows service does change the configuration require reinstall and install again?

c#,.net,configuration,windows-services

You don't need to reinstall the service. Stop the service Overwrite the necessary files in the service path Start the service again ...

Ftp requests in Windows Service Timing out

c#,ftp,windows-services

request.GetResponse(); Your snippet is very incomplete, but surely the problem started here. GetResponse() returns an FtpWebResponse object, it is crucial that your code calls Close() or disposes it to ensure that the Ftp connection is closed. If you forget then you will have 100 active connections after downloading 100...

Instrumenting windows service with Application Insights

azure,windows-services,ms-application-insights

I'll make the docs a bit more clear on this. You can instrument anything if there's a core SDK that will build with it. So any kind of .NET, Java, PHP, OSX, iOS, Android, .... If you want additional modules that log web requests, crashes, etc, you're a little bit...

C# How to install Windows Service as part of application installation

c#,visual-studio-2013,windows-services,windows-installer

Since VS2013 does not contain the old (VS2010) Visual Studio installer project, I have these suggestions: Use WiX installer: https://wix.codeplex.com There is even a service installer template (not tested): https://visualstudiogallery.msdn.microsoft.com/7f35c8ce-1763-4340-b720-ab2d359009c5 Use VS 2013 install extension There were many complaints that MS abandoned the old setup project, so they brought it...

Windows service not in the services list thought it is being installed successfully

c#,.net,visual-studio-2012,windows-services

To actually install the service, you have to register it with the Service Control manager. The simplest way to do this is with SC.EXE. http://support.microsoft.com/kb/251192 Example: SC.EXE create "MyService" binpath= "\"c:\program files\MyService\MyService.exe\" arg1 arg2" displayname= "My Service Name" This creates a service, and tells the Service Control Manager that to...

Running .bat through Windows Services vs Startup Folder

batch-file,windows-services,startup-folder

The service will run automatically when windows boots up and also restart automatically if the service fails. You can manage service options by running services.msc https://technet.microsoft.com/en-us/library/cc755249.aspx...

Reference Microsoft code of service application is not thread-safe?

c++,multithreading,windows-services

The code is nearly thread-safe, because the main thread and the callback thread use the global variables at different times - the main thread during service startup, the callback thread only once the service is running, and the main thread again when the service is shutting down. However, the second...

Registering a windows service as automatic (not manual) but stopped

windows-services,registration,installshield

Assuming a Windows Installer project type in InstallShield, there are 2 different tables at play. ServiceInstall and ServiceControl. It is completely possible to define the service using ServiceInstall with start type Automatic and not actually start the service during the installer. It's the ServiceControl table that controls when to start/stop...

Windows Service keep crashing with Faulting Module SHLWAPI.dll

c#,.net,windows-services,64bit,windows-server-2012

yes, it was a bug in the application only. it was a rare scenario which was going into a deadlock situation. Fixed...

Visual Studio refuses to build project due to missing assembly reference that isn't missing

c#,.net,visual-studio,windows-services,assembly-references

1.remove all references 2.Build --> Clean solution 3.Clean your project using goo.gl/vvrxGd as sometimes visual studio fails to clean everything neatly....

Jenkins can't use net start ?

jenkins,windows-services,batch-processing

Okay i found out what was wrong: For some reason jenkins didnt have my net.exe on the path So what worked: pathtoNet.exe start servicename...

How to create an event which fires after any file is modified or created or deleted in the filesystem

c#,winapi,events,windows-services,filesystems

You just need to initialize FileSystemWatcher and subscribe to relevant events. FileSystemWatcher watcher = new FileSystemWatcher(@"DirectoryPath"); watcher.Filter = "*.*";//Watch all the files watcher.EnableRaisingEvents = true; //Specifies changes to watch for in a file or folder. watcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.Size; //Subscribe to the following events watcher.Changed += new FileSystemEventHandler(watcher_Changed); watcher.Created...

How to create a scheduled long running process using windows service in c#

c#,multithreading,windows-services

Your situation might be better suited for a scheduled task as Lloyd said in the comments above. But if you really want to use a Windows service, this is what you would need to add/update in your service code. This will allow your service to list as started and not...

Windows Service unexplainably stops when started in SCM

c#,windows-services

The problem turns out to be that you can't set the ServiceName property from the OnStart method. this.ServiceName = MyServiceName; should be in the constructor instead, as it seems like it is necessary to set it. The ServiceName identifies the service to the Service Control Manager. The value of this...

EF6 DbContext IOC Dependency

c#,entity-framework,visual-studio-2013,dependency-injection,windows-services

To address decoupling (and testing), you can create your own interface for your DbContext (IMyDbContext), and re-expose all the typed entity DbSets, SaveChanges(), and possibly a few other methods. You should also make this interface Disposable. public interface IMyDbContext : IDisposable { IDbSet<Foo> Foos { get; set; } IDbSet<Bar> Bars...

Communicate with WinForms app while it's running

c#,.net,winforms,windows-services

Unfortunately I don't have a simple answer. There are several choices for IPC(Inter Process Communication) such as: Mailslot, NamedPipe, Memory Mapped File, Socket, Windows Messaging, Remoting, WCF, Web sockets with a local web server, watching a shared file, message bus, ... See more at: Passing Information Between Applications in C#...

How to do long running job and not wait for the result with ASP.NET MVC?

asp.net-mvc,push-notification,windows-services,long-running-processes

Don't use a threads of the web application for long running tasks because you will end up having scalability issues because the number of threads are limited. This is work for a windows service and to decouple it from the application creating the jobs use a queue (something like msmq,...

Windows Service Overlaps

c#,windows-services

The typical solution I've used when developing this kind of service is to NOT actually use a reoccurring timer. What I do is create a single shot timer set to tick off in 15 minutes. When the timer's proc begins I record the current time, and use that to find...

Why Timer has no properties, how to get it's interval after initialization?

c#,.net,multithreading,timer,windows-services

Why is there no property in the Timer-class which indicates the current period/interval? I assume (I'm not part of the .NET implementation team, so have to assume) this is because it used a Win32 Waitable Timer. And there is no API to get the settings of a Waitable Timer....

Send UDP data from Windows Service to browser running webpage on same machine

c#,node.js,websocket,socket.io,windows-services

Use Signal R. This is a technology which automatically negotiates the most efficient transport for pushing events from a server to a browser (eg Forever Frames, Web Sockets) - it will fall back to the polling approach you mention in your question if required. I think this is a better...

Is Contexts.Context.Parameters deprecated in .NET 4.5?

c#,.net,windows-services

The only occurrence of Context.Parameters that I can find on that tutorial page is in the following code snippet, in step 3 under "Adding startup parameters": protected override void OnBeforeInstall(IDictionary savedState) { string parameter = "MySource1\" \"MyLogFile1"; Context.Parameters["assemblypath"] = "\"" + Context.Parameters["assemblypath"] + "\" \"" + parameter + "\""; base.OnBeforeInstall(savedState);...

c# getting ip address of user who remotely connect to machine

c#,windows-services,ip-address,remote-connection

I found related solution in c# specifically Grabbing Information of a Terminal Services Session Programmatically...

Distinguish Windows services with the same ProcessName

powershell,memory,windows-services,monitoring,powershell-v3.0

You say that the path to executable is different - this way you can distinguish the processes by querying path property. Should they be equal, you can also query StartInfo object of a process to get Arguments property to discern from one another. But the best way to get correct...

How to use CreateProcessAsUser with argument is japanese?

c#,c++,windows-services

Use CharSet = CharSet.Unicode in all of structures and CreateProcessAsUser routine

Problems to connect to a SignalR Self-Hosted in a Windows Service

c#,asp.net,windows-services,signalr-hub,signalr.client

As pointed by Christophe, this question is a duplicate of SignalR Java client only supports exactly 1.3 and, in my case, was solved by uninstalling and re-installing all the SignalR/Owin packages.

Multiple copy of IIS Site, Databases and Windows services

c#,asp.net,sql-server,windows-services,iis-7.5

I am doing similar things by using different build configurations for that. Create a new build (solution) configuration for each customer. Right click solution and select 'Configuration Manager'. Add new configuration with customer name and select to copy settings preferably from Release config. Once you've done that you are able...

.Net Quartz Scheduler 2.3 does not work on the remote server

windows-services,quartz.net

Are you running the two methods in the windows service OnStart? Are you using a service account? Any exceptions in the event viewer/ have you started /stopped the service from services.msc?

Generate memory dump for a windows service that stops unexpectedly

windows,windows-services,windbg,memory-dump

1) Download ProcDump 2) At an admin command prompt, in the same directory as procdump, type this: procdump -ma -e <serviceprocessname>.exe 3) Wait for crash and dump will be generated...

How to handle dispose when it's in a generated partial class

c#,windows-services,dispose

If you are going to modify Dispose implementation then copy it over to the code behind class from designer.cs. It is one of the few places in designer.cs that should be modified. The same is true for Windows Form class as well. ...

Boot order on windows: Services vs scheduled tasks?

windows,windows-services,scheduled-tasks,vhd,virtual-disk

schtasks.exe use service called Task Scheduler, You can try to add it as dependency to your automatic service. When the computer starts, it uses this entry to verify that the service or services listed in this value ("DependOnService") are started before attempting to start the dependent service. Read this KB...

Fake.Deploy Running custom Windows Service locks deployment files and thus updates

f#,windows-services,f#-fake

Just do not install your service from directory where FAKE unzip it. Do it like this: Check that target directory is exist. Create it if it is not Check if service is installed and uninstall in this case Clean target directory (to be sure that everything is removed) Copy files...

SignalR self hosted windows service, listening for messages

c#,windows-services,signalr,self-hosting

In general SignalR offers a real-time messaging environment with the benefit that it can push messages to clients without them requesting the update (you've read the intro, so enough for that). Whether you start your self-host from within a service shouldn't make a difference. From what I understand from your...

Windows Service Exception - Could not load file or assembly Newtonsoft.Json

c#,json,windows-services,json.net

If you are planning to convert array into Json, no need to use outsourced dll's. VS 2010 has JavaScriptSerializer to approach this task. The example is as follows: using System.Web.Script.Serialization; JavaScriptSerializer js = new JavaScriptSerializer(); var json = js.Serialize(strYourArrayString); ...

Unable to run user service. Exception: Failed to start Java, ServiceStart returned 4

java,windows,service,windows-services

I made bellow changes to make my service work successfully. Folder Structure: C:\MyService1 \myService1.exe \myService1w.exe \MyService1.class \HelloWorld.jar \logs Java Class (Daemon Class): Created java class in default package The class has two static methods: start() and stop() start() should have a infinite loop Below is the snippet from my class....

Controllable Azure Worker Role Crash Recovery

c#,azure,windows-services,azure-cloud-services

Both web and worker roles will unconditionally recycle whenever there's an unhandled exception in RoleEntryPoint Run() method or the role entry point process exits. If there's a new exception it will recycle again. The recycle process includes restarting the role process and optionally cleaning up the "local storage" resources. Maybe...

Windows Service Failing Due to Timeout

c#,windows-services,timeout

No need for a code dump. When services are started by the system, they only have a short amount of time to return from the OnStart method before you get that message. The solution is to move all computationally intense work onto a different thread. ... Of course, you're already...

Exception occurred while fetching Azure certificate

c#,azure,windows-services

Please put the management certificate in LocalMachine certificate store instead of CurrentUser store and change the code accordingly to read from LocalMachine store. As you can see from the error message, your Windows Service is not able to find that certificate in CurrentUser store. Most likely it is because the...

C# Windows service, cannot get WCF bindings

c#,wcf,windows-services

The config has a BasicHttpBinding, your code is asking for a BasicHttpsBinding.

Is it possible to access redemption method of outlook add in using windows services

c#,windows-services,outlook-addin,outlook-redemption

Do not use Outlook Object Model in a service. Secondly, you are assuming that you only have ContactItem objects in the folder, your code will break if there is a distribution list there. The RDO family of Redemption objects can be used in a service...

Create installer with Installshield that installs Windows Service

windows-services,installshield

Please see my answer under Wix installer to replace INSTSRV and SRVANY for user defined service installation The WiX ServiceInstall and ServiceControl elements are abstractions for the underlying Windows Installer ServiceInstall and ServiceControl tables. InstallShield uses this same feature but instead of authored as XML it's authored in the components...

Where does a WCF service hosted in a Windows Service read its config from?

c#,.net,wcf,windows-services,app-config

It would be looking at YourServiceName.exe.config in the deployed folder....

Why is SysWOW64 reported as System32?

.net,windows-services,64bit,windows-7-x64,syswow64

It's a bit confusing, but SysWOW64 is actually the 32 bit emulator for 64 bit systems. WOW stands for "Windows on Windows", and the original SysWOW was the 16 bit emulator for 32 Bit Windows (and should have been called SysWOW32). So SysWOW64 is the 32 bit emulator for 64...

CherryPy silence logging not working on Windows Service

python,windows-services,cherrypy

Follow the docs Basically your config should looks like: {'global': { 'log.screen': False, 'log.error_file': '', 'log.access_file': '' }} ...

ASP.Net Architecture solution/suggestion

c#,asp.net,wcf,architecture,windows-services

Is this a good architecture? Agree with other commentors, you can do your entire solution in ASP.NET using something like hangfire to handle the background tasks. I have used this framework in my current project to handle different types of long running tasks and it's rock solid, especially combined...

C# Topshelf TimeoutException

c#,.net,windows-services,topshelf

This error is happening because you are running the extract and process methods in the Start method of the service. This is OK in Visual Studio, but when you install the service and start it, the Service Control Manager waits for the Start method to return, and if it does...

Window Services start-stop permission to Remote Desktop users

windows-services,rdp

Step 1 – Create the Console We need to open a hidden console snap-in 1. Click Start > Run (or press WIN + R) and type “mmc.exe” 2. This opens an empty Microsoft Management Console. Click File > Add/Remove Snap-in… (Ctrl+ M) 3. Scroll down the list of available Snap-ins...

Windows Service Start Failure for self hosted SignalR

c#,windows-services,signalr,windows-server-2012

Although this is not a direct answer too the problem I was facing, I do believe it may help many in the future: https://damienbod.wordpress.com/2014/06/03/signalr-self-hosting-template-for-a-windows-service/ It solved my issue by me vigorously going through the link. The link above is absolutely outstanding and gives great insight into Windows Services....

Using command line tool SC.exe to append fail count on windows service failure

windows,windows-services,recovery

When specifying the command, just include /fail=%1% in the arguments. So, your command would read: SC failure "myservice" run/0/run/""/0 reset= 86400 command="mycommand.exe /fail=%1%" Note that your parameter will be something like /fail=2, so you'll need to trim your parameter to get the actual count. I wasn't sure if you were...

Windows Service executes code in debug, but not in release

c#,web-services,wcf,windows-services

The problem wasn't my code, it was with the permissions when running the service. The service was being started as local systemaccount, but it didn't have permissions to run the service/execute the code. To change the account that runs the service: Open services.msc Right click the service name Go to...

C# Login data of Service

c#,windows-services

You can use identity.Name. For localsystem account it's value is NT AUTHORITY\SYSTEM. A little code to test it could look something like this: FileStream fs = new FileStream("C:\\test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new StreamWriter(fs); try { System.Security.Principal.WindowsIdentity identity = System.Security.Principal.WindowsIdentity.GetCurrent(); sw.Write(identity.Name); } catch (Exception ex) { sw.Write(ex.Message); } finally...

How to use Autofac container to resolve an instance of a type?

windows-services,autofac

This is pretty standard dependency resolution/automatic wire-up stuff. As long as you have all of your dependencies in the container, resolving ISomeInterface will automatically also chain in any dependencies like IOtherInterface. var builder = new ContainerBuilder(); builder.RegisterType<SomeInterfaceImp>().As<ISomeInterface>(); builder.RegisterType<OtherInterfaceImp>().As<IOtherInterface>(); var container = builder.Build(); There is a good getting started guide on...

Is it possible to include Quartz.NET library in Windows Service?

windows,windows-services,quartz.net

Problem was with Reference libraries. I've had installed version 4.x in Visual Blend folder and the newest in my project. That was causing conflicts. When I created service as a new project and redownloaded all libraries it worked. So, yes it if perfectly possible to include Quartz.NET in windows service...

WCF: Difference between hosting in IIS and WIndows service

c#,.net,wcf,windows-services,hosting

Check out the documentation: https://msdn.microsoft.com/en-us/library/ms730158%28v=vs.110%29.aspx It is awesome! And the answer to your questions depends on what kind of application you are building and other requirements on the application/environment...!...

How to notify an application from windows service using WCF

c#,wcf,windows-services,ipc

So using callbacks is certainly one way of doing this. However, the callback channel can timeout and so you'll need a way of automatically reconnecting. If you want to continue down this route then you're looking good understanding-wise. In my opinion, a simpler (and therefore superior) solution is to use...