.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Windows Service running on W2K3 but not working on W2K8 R2

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :.NET Framework

I do have a bunch of windows services (written in C#) that all use the same pattern - there's a class library which has a public Start and Stop method - and those methods are called by my service wrapper at the appropriate point in time. The class lib also has a main method and can run as standalone software - it's just a project configuration switch to decide if I want the actual program logic as a dll or an exe.

So far so good - in recent days I made some changed to one of my services that had been running just fine on dozens of machines. When I wanted to upgrade though, I ran into some issues. My staging box is a W2K3 R2 box, and there I had no trouble running the newly compiled service (the service .exe file was left.. but dll was changed). Then I went to our production machines which use W2K8 R2, and then the following happend:

The service controller reports that the service cannot be started. In the Event Viewer, I see an event 7009 ("A timeout was reached (30000 milliseconds) while waiting for the xyz service to connect"), then followed by an event 7000 ("The xyz service failed to start due to the following error: The service did not respond to the start or control request in a timely fashion").

I then went ahead and changed the output type of my dll project to commandline, added the exe to the path where the service resid

View Complete Post

More Related Resource Links

WPF consuming WCF Service with Windows Authentication - Not Working

Hi I am developing a WPF application in .NET 4.0 which calls a WCF Service hosted on the server developed in .NET 4.0. I want to use windows authentication for this purpose and it seems that it is not working and keep on giving me following error. The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via I do not want to use https as this is an Intranet application. The WCF Service inturn calls SQL Server SPs via Entity Framwork 4.0. Following is the Web.Config for WCF Service. <?xml version="1.0"?> <configuration> <connectionStrings> <add name="MsdbEntities" connectionString="metadata=res://*/MsdbModel.csdl|res://*/MsdbModel.ssdl|res://*/MsdbModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=lvapxdev\lvw_uat_02;Initial Catalog=msdb;Integrated Security=SSPI;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> <appSettings> <add key="IndexLoaderInstallDirectory" value="D:\Longview\Index Loader\"/> </appSettings> <system.web> <compilation debug="true" targetFramework="4.0" /> <customErrors mode="Off"/> <authentication mode="Windows"></authentication> </syst

Windows Server Backup fails when SQL VSS Writer service is running


Hello. On one of our SQL servers, we have SQL Server 2008 Express installed. Whenever is the "SQL Server VSS Driver" service running, backing up the computer with Windows Server Backup will always fail. If I stop SQL VSS writer service, then it the backup will finish successfully, although apparently backup of the SQL DBs is not consistent.


- backup is executed with "wbadmin start backup -allcritical -backuptarget:d: -vssfull -quiet"

- root of the SQL Server instance (and all DBs, trans. logs etc) are located on a volume E:

- once the backup command is executed, it's stuck on the creating volume shadow copies operation for several minutes, failing afterwards

- SQL VSS Writer has status 8 (failed), last error is "non-retryable"

- eventlog contains myriad of messages since the backup is started (SQL server has hundreds of DBs on it), with variations of these 3 repeating:

  a) SQLVDI: Loc=TriggerAbort. Desc=invoked. ErrorCode=(0). Process=1304. Thread=15788. Server. Instance=SQLEXPRESS. VD=Global\{A4C1E365-459A-4D41-B3D0-1A76DB8E56F6}517_SQLVDIMemoryName_0. Source: SQLVDI, EventID: 1. This is repeated numerous times, where thread id varies and number (517 in this case) in the VD identifier

  b) BACKUP failed to complete the command BACKUP DATABASE

Cant move system databases of SQL Server 2008 (Clustered) running in Windows 2008 with Service SID e



I was trying to move system databases of SQL Server 2008 on clustered emvironment running on Windows 2008.

I remember while doing the cluster installation somewhere it gave me a recomended option of using Service SID. I think that is the culprit here. Because if you see the "Security" of the DATA folder containing all the MDF and LDF (by default location) you will find a Group named "MSSQLSERVER" is having full access to that directory.

While moving the system databases you need that account (MSSQLSERVER) given access to the parent directory containing the MDF and the LDFs, But unfortunately you cannot add that account manually. Even I tried XCOPY to make sure that while copying the ACLs gets transferred properly to the destination, even that failed.

I think it does provide a solid Security but at the expense of Maintenance, which I cant agree.

Also I forgot to tell you that this Sevice SID option is available if you are using Windows Vista / Windows 2008 or above,

Does anyone has any experience of moving the system databases with Service SID enabled in a cluster environment.

As a testing just try to copy/xcopy/robocopy any folder having MSSQLSERVER group in the ACL and see what happens .. If you are lucky like me then you will get ACCESS DENIED error.

Have anyone faced the same error? I h

Windows Service .NET running on CLR 4.0 High CPU Usage


We have a windows service which hosts different appdomains. This processes uses remoting over IPC and TCP to communicate across the different app domains and with other processes.


This process is compiled using .NET framework 2.0 (vs2005) but we forced it to run on CLR 4.0 using the following entry in the config file.

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>


The problem is that after some hours of running, the process starts eating up the CPU cycles. When debugging with WINDBG we notice that the thread consuming much of the CPU is in fact the Garbage Collector (<gcServer> is set to true).


On inspection of the Heap we notice that there is a very huge array on the LOH of the type System.LocalDataStoreElement with around 18million entries all set to null. This array is copied and increased each time, which is what is causing the cpu issue.

Now in our services we are passing Identities to impersonate user in the other appdomains / processes in the Named dataslots for the different threads (we have an object which implements the ILogicalThreadAffinative).


This issue is not present if the process runs on the CLR 2.0. Anybody can shed to us som

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

Not working on Windows Server 2008




I had the CSS friendly adapters working great on our old server (windows server 2003 - 32bit) and now we have moved to a 64 bit environment and now I can not get the CSS friendly adapters to work.

We are using SharePoint 2007.

Is there another work thru for 64bit environment.

I notice windows server 2008 has a directory  C:\Windows\Microsoft.NET\Framework64 would I be using the browser file in this directory???

Please help!

Foundations: Working With The .NET Service Bus


The .NET Services Bus is arguably the most accessible, powerful, and useful piece of the new Windows Azure Cloud Computing initiative. See how it manages cloud communications.

Juval Lowy

MSDN Magazine April 2009

Web Service Workflows: Deploy Distributed Business Processes With Windows Workflow And Web Services


Due to the distributed nature of a business process it makes sense for a workflow to be deployed as a distributed application. See how Windows Workflow and Web Services hold the key.

Israel Hilerio

MSDN Magazine October 2006

Service Station: Serialization in Windows Communication Foundation


Windows Communication Foundation supports several serialization mechanisms and provides a simple, interoperable foundation for future service-oriented applications. Here Aaron Skonnard explains it all.

Aaron Skonnard

MSDN Magazine August 2006

Windows Services: New Base Classes in .NET Make Writing a Windows Service Easy


Windows services are applications that run outside of any particular user context in Windows NT, Windows 2000, or Windows XP. The creation of services used to require expert coding skills and generally required C or C++. Visual Studio .NET now makes it easy for you to create a Windows service, whether you're writing code in C++, C#, or Visual Basic. You can also write a Windows service in any other language that targets the common language runtime. This article walks you through the creation of a useful Windows service, then demonstrates how to install, test, and debug the service.

Ken Getz

MSDN Magazine December 2001

Develop a Web Service: Up and Running with the SOAP Toolkit for Visual Studio


The new Simple Object Access Protocol (SOAP) Toolkit for Visual Studio 6.0 provides the infrastructure for developers to build, expose, and consume Web services. With a few exceptions that are outlined in the toolkit, the SOAP Toolkit complies with the SOAP version 1.1 specification. It includes the Remote Object Proxy Engine (ROPE), a Service Description and Code Generation Wizard, and code that provides ASP and ISAPI reference implementations of SOAP listeners. This article describes the tools and the object model of the SOAP Toolkit, and then demonstrates ASP and ISAPI implementations of a functional Web service using this toolkit.

Rob Caron

MSDN Magazine August 2000

Office Sharepoint Server Search not working but Windows Server Search is.

I am having an annoying Issue with the Sharepoint 2007 Enterprise search functionality. I cannot get the Search Centre to work, the out of the box webparts crash the page except the Searchbox when the others are closed. The event viewer shows up numerous Errors (Office Sharepoint Server - EventID 7080) returns with and the same when trying to add a search related web part (e.g. core.results, federated etc). EventID 6398 - Timer is a regular as is 7080. Details below.

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified).

Remote connections are connected, I am not 100% on the Instance name, (how would I go about checking this?)

Also I cannot access the link to SharedServices1 - Open Shared Services Admin site (not clickable), guess it's permissions but I seem to have full site permissions, I think I need SSP-Admin to make more edits to the Search, maybe this is related :s

Both Search Servers are runnig, I have tried everything I can think of to fix this and allow the Search Centre to work.

I am running Sharepoint 2007 on SQL Server 2008.

Video: Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services

Watch this visual how-to video as you learn to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0. (Length: 7:56)

Coding a Long-Running Operation Page in SharePoint Server 2007 or Windows SharePoint Services 3.0 (V

Watch the video and explore code as you learn how to write code to mimic the default long-running operations page (the "spinning wheel") in SharePoint Server 2007 or Windows SharePoint Services 3.0.

Getting AppDomain.UnhandledException event to work in a Windows Service

Nearly every forum thread I have found on "catching unhandled exceptions in a service" seems to end up where I am.  The supposed solution is the use of the AppDomain.CurrentDomain.UnhandledException event.  But it doesn't work for someone, who then asks why and gets no answer.  Same for me; I can't get the event to happen.  It's as if I need the ServiceProcess version of Application.SetUnhandledExceptionMode(), which doesn't exist. For diagnosing this, I start a timer in a child object of the service and then throw an exception in the timer event handler.  Simple enough to simulate the real situation.  I have tried subscribing to the UnhandledException event in at least a half dozen locations throughout the service, from the Program that runs ServiceBase.Run() to the constructor of the object that owns the Timer, but it never catches this exception. The VS debugger recognizes that the forced exception is unhandled and takes me to the place where is thrown, letting me know it is an unhandled exception. Why doesn't my handler catch it?  Running without the debugger, the exception throws, the timer thread crashes, the service continues merrily along, and nothing gets logged anywhere.  That is NOT the result I need.  What are the people for whom this works doing that I am not doing? How can I at least get the offe

Windows Identity Foundation Security Token Service can't stay logged in

I'm using the Windows Identity Foundation **(WIF)** Security Token Service **(STS)** to handle authentication for my application which is working all well and good. However I can't seem to get any long running login with the STS. From my understanding I shouldn't care about the client tokens at the application level since they can expire all they want to and it should redirect me to the STS and as long as they're still logged in on the STS it should refresh their application token. Yet it doesn't seem to want to keep them signed in. Here's what occurs in my login.aspx on the STS var cookie = FormsAuthentication.GetAuthCookie(userName, persistTicket); if (persistTicket) cookie.Expires = DateTime.Now.AddDays(14); Response.Cookies.Add(cookie); var returnUrl = Request.QueryString["ReturnUrl"]; Response.Redirect(returnUrl ?? "default.aspx"); Which was taken almost directly from existing application using normal Forms Auth. From my web.config <authentication mode="Forms"> <forms loginUrl="Login.aspx" protection="All" timeout="2880" name=".STS" path="/" requireSSL="false" slidingExpiration="true" defaultUrl="default.aspx" cookieless="UseDeviceProfile" enableCrossAppRedirects="false" /> </auth
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend