.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

Deveoping Windows Service with C++ and cannot install it

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


Sorry if i posted in wrong forum.

I am developing my first windows service with C++. I made a new windows service project, added some references in stdafix.h, some code in OnStart and OnEnd and compiled it. 

Then i've ran Earthshaker.exe -Install (obviously Earthsaker being the service project name)

It said alot of stuff (in russian, no use posting here) that can be summarised that service was installed and fixated successfully.

But i cannot see this service in the list of services! I cannot turn it on thus i cannot debug it. 

I tried to run Earthshaker.exe -Install -u and then Earthshaker.exe -Install again, it said it uninstalled, then it said it installed, yet again, nothing changed! Nothing! Service isnt there and i cannot turn it on and make it work.

View Complete Post

More Related Resource Links

Solved: InstallUtil throws ArgumentOutOfRangeException when trying to install windows service.

This is just to help people troubleshoot the ArgumentOutOfRangeException problem when trying to install a windows service with installutil. It took me a good while to understand the reason of the install failure and I could not find anything about this on the web concerning this problem, so hopefully this will help others in the future so they don't waste as much time as I did.

If you get:

An exception occurred during the Install phase.
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length


1) Go to the deisgner of your ProjectInstaller
2) Select the ServiceProcessInstaller
3) Go to the properties of the ServiceProcessInstaller.
4) If you see Account property set to user, change it to LocalSystem.
5) Rebuild your project.
6) Rerun installutil YourService.exe

Then the exception should be gone and the installation successful.


Sylvain Boissé Software Architect Noesis Innovation www.noesisinnovation.net

Install a wcf as a windows service and copy files from a network location



I need to intall a WCF as a windows service. In side this WCF , I need to copy files from a network location to the local machine and run them.

I tried to give a specific user account ( which has access to the shared location)for the windows service processinstaller and install the service. but this account cant host the WCF since it does not have admin rights.

Is there a way to host the WCF using local account.. and then to access network location in side the wcf using a specific account. ( impersenation??/ )

Thanks in advance.





Microsoft SQL Server 2005 Express Edition Service Pack 3 (KB955706) windows update install error 0xD

I have tried several times to use Windows Update to install the SQL Server 2005 Express Edition Service Pack 3 (KB955706) but it keeps failing.  When I check the install history all I get is error code 0xD59

I have Windows XP SP2 on a Core 2 Duo Dell Vostro 1500

Install Windows Service Error

Hi to all,
I made a Windows Service that I can install fine in my developer machine (Win XP SP2 with Framework 2.0.50727.1433).
But when I want to install the same Windows Service in my production machine I;m getting this error:

   Creating EventLog source WindowsServiceTest in log Application...

   An exception occurred during the Install phase.
      System.Security.SecurityException: Requested registry access is not allowed.
         at System.ThrowHelper.ThrowSecurityException(ExceptionResource resource)
Thinking that is a security/permission error, I change this to use a user that has administrative profile, then when try to install I got an error again:

   Affected parameters are:
      logtoconsole =
      showcallstack =
      i =
      logfile = D:\Test\WindowsServiceTest.InstallLog
      assemblypath = D:\Test\WindowsServiceTest.exe

   An exception occurred during the Install phase.
   System.ComponentModel.Win32Exception: Access is denied
   at System.ServiceProcess.ServiceProcessInstaller.OpenSecurityPolicy()

Really I don't know what to do. Any Help? or idea?
Thanks in advance.

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.

SqlServer - Windows Account to install Application from Gallery


Referring to this tutorial: http://www.asp.net/webmatrix/tutorials/download-and-install-an-asp-net-application

I selected umbraco cms and got this wizard:

I already have Standard Sql Server 2005 on my machine which I wanted to us for above DB and not SqlExpress.

I did not remember "sa" account pwd nor I use explicitly any account to connect to my Sqlserver. I use Windows Authentication account i.e implicit authentication. So I created new account and gave all rights and used it in the above wizard and was able to install the database after some struggle.

My question is: What if I want to use my Windows Account to install the database above? Why the wizard don't have any option to use Windows Integrated Authentication?

Note: I can create the DB with external user I created, just looking specifics for using Windows Authentication for above installation.

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

How can Install Office 2007 on Windows server 2008 R2 64 bit machine in WSS 3.0

I have  64 bit machine  and Windows server 2008 R2 has installed. i have successfully install WSS 3.0  , but  when i tried to install  office 2007 ,  one  error  has  come  "OS is not compatible "  i thought  it was asking  for 64 bit office  2007   and i go through the  google and R&d find no 64 bit office is available ,  i have used   excel .dll in my custom code  so my problem is that   how can  install office 2007  on 64 bot OS 2008 r2  machine .  if anyone can help   me  , please let me know . thanks in advance

VS 2008 Install - Windows Mobile 5.0 SDK R2 for Pocket PC: [2] Error: Installation failed for compon



I am trying to install VS2008 on my Windows XP machine. I have MS Office 2003 and SP2. Disabled the Norton Anti-Virus. I am getting the following error. I appreciate if some one can help me.

[08/26/10,07:04:36] Windows Mobile 5.0 SDK R2 for Pocket PC: [2] Error: Installation failed for component Windows Mobile 5.0 SDK R2 for Pocket PC. MSI returned error code 30
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Windows Mobile 5.0 SDK R2 for Pocket PC is not installed.
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Windows Mobile 5.0 SDK R2 for Smartphone was not attempted to be installed.
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Microsoft Device Emulator version 3.0 was not attempted to be installed.
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Microsoft SQL Server 2005 Express Edition (x86) was not attempted to be installed.
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Crystal Reports Basic for Visual Studio 2008 was not attempted to be installed.
[08/26/10,07:04:39] VS70pgui: [2] DepCheck indicates Microsoft Windows SDK for Visual Studio 2008 Tools (x86) was not attempted to be installed.
[08/26/10,07:04:40] VS70pgui: [2] DepCheck indicates Microsoft Windows SDK for Visual Studio 2008 Headers and Libraries (x86) was not attempted to be installed.
[08/26/10,07:04:40] VS70pgui: [2] DepCheck indicates Microsoft

SQL Server Reporting Services not able to install on Windows Vista Home Premium


Recently I had a weird problem while trying to install SQL Server Reporting Service in my local PC. I am using Windows Vista Home Premium and I wanted to configure SSRS in my PC. During the installation, the setup wizard listed all the services that we want to install and I found that only Reporting Server checkbox option was disabled and I wondered why??? I thought it may be becuase of some installation problem and tried again and its useless... I googled lot of sites for 3 days and finally found that due to some IIS issues, it is not possible to install Reporting Server in Vista Home Premium version. Reporting Server needs some specific IIS features to be installed in the machine.

But unfortunately those features are not available for Home Premium users which in term restricts users not to install reporting server in our PCs... Also, Microsoft has accepted it as an issue and its not possible to get it install in Home Premium...just wanted to share and might be useful for someone like me.

Reference: http://support.microsoft.com/kb/920201/en-us

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

Cash Drawer - Method Open threw an exception - Windows Service

Hi All, I'm getting the following exception while calling Open method of Cash Drawer object. Method Open threw an exception.  Could not read the device name key's default value, or could not convert the Programmatic ID it holds into a valid Class ID. Code:   class Class1 { CashDrawer _uniCashDrawer1 = null; DeviceInfo cashDrawerDevice1 = null; PosExplorer posExplorer = new Microsoft.PointOfService.PosExplorer();   public void ClaimCashDrawer() { cashDrawerDevice1 = posExplorer.GetDevice("CashDrawer", "testDrawer"); if (cashDrawerDevice1 != null) { _uniCashDrawer1 = posExplorer.CreateInstance(cashDrawerDevice1) as CashDrawer; if (_uniCashDrawer1 != null) { _uniCashDrawer1.StatusUpdateEvent += new StatusUpdateEventHandler(UniCashDrawer1_StatusUpdateEvent); _uniCashDrawer1.Open(); _uniCashDrawer1.Claim(0); _uniCashDrawer1.DeviceEnabled = true; } } } }   Tha above code works fine if you put the code in WindowsApplication in all POS systems. The same is working if you put the code in Windows Service in all other POS systems. The same is not working if you put the code in Windows Service in Aures Galeo POS systems.  Thanks in advance. Ramakrishnan S

I am not able to install oracle 10g on windows 7, Please let me know how can I do it or what could b

Dear Concerned,I have really become fed up while using windows 7, Please let me know how can I install oracle 10g and which of the version of oracle, windows 7  will accept so that I could start work on my laptop ...Thanks and RegardsRahul Kishan

SQL Server 2008 R2 fails after Windows XP Pro SP3 install

We recently encountered an issue with SQL Server 2008 R2 failing to run after the upgrade from Windows XP Pro SP2 to SP3. This was tested and reproduced (with varying results) on more than one computer. Steps to reproduce this. On a Windows XP Pro machine with Service Pack 2 installed, install SQL Server 2008 R2. Next upgrade Windows to Service Pack 3. Now upon opening SSMS or trying to start the SQL server service you receive the following message: "This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem". In some instances reinstalling/repairing SQL Server 2008 R2 does fix the issue.  In other cases the installer crashes and you need to use msizap to clean it up before you can reinstall.  In other cases you do not receive any errors at all. After testing in multiple virtual machines it looks like the cleaner the Windows install the more likely you are to run into this issue.  On machines with most or all windows updates (prior to SP3) installed you do not necessarily even get the failure.  On machines with just Windows XP Pro SP2 installed with no additional updates you get the failure every time. Obviously the SQL Server 2008 R2 prerequisites are installed in all cases in order to be able to install SQL server to begin with. Any help with this would be appre
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