windows-services

Database clients: how to wait for database activation after SQL Server restart?

孤街醉人 提交于 2019-12-11 06:47:25
问题 Service dependency is not enough to guarantee that database clients will find their SQL Server up and running after a system reboot. They may be able to create a connection to the master database, but a specific database may still be in the process of opening (in the recovery mode) and connections to it will be refused for some initial period of time. The exact duration of the delay is highly variable and depends on factors such as number of databases on the system, recovery mode, LDF file

Why won't my .Net Windows service start automatically after a reboot?

血红的双手。 提交于 2019-12-11 06:47:02
问题 I get the error below in the event log when the computer boots, the service is set to automatically start, when I manually start the service it starts without a problem. Any ideas? Service cannot be started. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x80010002): Call was canceled by the message filter. (Exception from HRESULT: 0x80010002 (RPC_E_CALL_CANCELED)) at System.Runtime

SqlDependency doesn't fire OnChange event when dataset is changed

烈酒焚心 提交于 2019-12-11 06:39:56
问题 I'm new to the concept of query notifications with SQL Server and it's going to take some time for me to wrap my head around it. My objective is to create a Windows service application that is notified when a change has been made to a SQL Server table. I followed this guide which was helpful in getting me started. However I'm not able to get the expected result. The OnStart() method in my windows service app looks like so: protected override void OnStart(string[] args) { eventLog1.WriteEntry(

Windows.Media.Imaging Thumbnail generation causing exceptions

左心房为你撑大大i 提交于 2019-12-11 06:25:56
问题 I have recently made a change to a windows server to create thumbnails from a memory stream and return it, based upon http://weblogs.asp.net/bleroy/archive/2009/12/10/resizing-images-from-the-server-using-wpf-wic-instead-of-gdi.aspx. It does create the thumbnails correctly but after a few days it starts throwing errors like: Message: The operation completed successfully Exception Type: Win32Exception StackTrace: at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32

Create service installer for existing C# console application in Visual Studio 2015 Community

末鹿安然 提交于 2019-12-11 06:25:40
问题 I have an app (C# Console application). I know that in Visual Studio 2008 was the template for creating "Setup project". In Visual Studio 2015 Community this template is not available. What tools inside VS 2015 could help me to pack my app as a Windows service (within Windows 7) and create installer for it? 回答1: You may want to check out this extension for vs2k15: https://visualstudiogallery.msdn.microsoft.com/f1cc3f3e-c300-40a7-8797-c509fb8933b9 Also the learning curve is a bit steep but WiX

MSI Installer fails during uninstall when serivce was already removed

帅比萌擦擦* 提交于 2019-12-11 05:59:35
问题 I've an Installer with some custom actions & the designer fancy to install a windows service. From times to times, when I made a mistake in my custom actions (or in the MSI configuration) the upgrade process may fail. Solution is to uninstall the Application and do a fresh installation. But sometimes I'm ending in the situation, where I can't uninstall the Application because the "custom actions" for the service claims, that the service is not registered in the system. OK, maybe, no problem.

DateTime.ToString format inconsistent between Web App and Windows Service

二次信任 提交于 2019-12-11 05:58:19
问题 We are experiencing weird behaviour between a web application and windows service when trying to perform a ToString() on a DateTime value. See the example below. DateTime parsedReportDate; reportDate = DateTime.Now.ToString("yyyyMMdd"); reportDateWithSlash = DateTime.Now.ToString("dd/MM/yyyy"); if (DateTime.TryParse(MyDateValue, out parsedReportDate)) { reportDate = parsedReportDate.ToString("yyyyMMdd"); reportDateWithSlash = parsedReportDate.ToString("dd/MM/yyyy"); } --reportDateWithSlash on

ServiceStack communications with Windows Service

旧巷老猫 提交于 2019-12-11 05:49:46
问题 I have an multi layered application that I have developed. I communicate with the windows service using http with ServiceStack (AppHostHttpListenerBase). While this works fine in clean environments, I often find that customers computers are not so clean and one of the first problem areas is the introduction of an unwanted Proxy with causes my application not to run. I get alot of bad press that the application does not work well, when in reality it is a result of a hidden issue on the

An exception occurred in the OnAfterInstall event handler

蓝咒 提交于 2019-12-11 05:14:29
问题 NOTE: I have researched this issue for the past 2 days, I have seen very similar questions and answers but none have resolved my situation, therefore I am posing this question here after thorough research. I created a windows service and setup project in VS2013. Everything was working fine and the installer was working fine. I had an issue with the service not starting on the deployment machine because it could not find the .dll file it needed. While working on that, another issue started

Alternative of Dispatcher class (from .net 3.0) to use in .net 2.0 context

老子叫甜甜 提交于 2019-12-11 04:46:47
问题 I need an alternative for Dispatcher (.net 3.0) to use for a windows service (done in .net 2.0). Can you give me some idea how to achieve something like that or point me some links? I know that a dispatcher has a SynchronizationContext behind, but I don't know how I can use a SynchronizationContext into a service. If you think that I should stick to the Dispatcher (.net 3.0) ... how can I manipulate it ( OnServiceStop , OnServiceStart ) edited: More details (see also...here) Idea is that I