Tuesday 31 March 2015

Make sure a windows service is really removed

Sometimes when I uninstall a service with Topshelf everything reports back as normal but the service could still be seen in the services pane.

An alternative way to force a removal of a service is to use:


I was then given the message:

 "The specified service has been marked for deletion" with FAILED 1072

The service was still visible in the services pane even though I refreshed it.

The problem was that I had task manager (with the process view) running. After having closed task manager I re-run the above code and then got the message "The specified service does not exists as an installed service" with failed 1060. After a refresh it was not removed from the services pane. 

Case closed!


Friday 20 March 2015

Windows service: The service cannot accept control messages at this time

So I had just updated a windows service with some errorhandling so that a mail will be sent if the service crashed or was stopped or shutdown. When I tried to manually stop the service both from the services gui or from a command prompt I was greeted with:

Error: 1061 The service cannot accept control messages at this time 


No matter what I did I always got the same message. I waited and I don´t remember if I even rebooted the computer but the only way in which I could take control of the service again was to manually choose end task for the process in windows task manager.


Friday 13 March 2015

Enable function keys as default in Surface Pro 3

While setting up my development environement with Visual Studio 2013 in my Surface Pro 3 I got annoyed that in order to use the function keys like F9 for setting breakpoints etc, I had to press the fn + F9. One workaround to that is to press

fn + capslock

that enables the function keys to work as expected by default. Just press fn + capslock to restore it back to what it was.

VS 2013 - ASP.NET installation issues

When I replaced my laptop to a Surface Pro 3 I had to manually set up my development environment for all customers I work for. This is a one time installation that I am only doing every other year and so I have forgot all traps that one could fall into when doing a first time installation. 

Here is my "unexpected" problems that occurred and how I solved them

  • One of the obvious problems was that I had trouble compiling my projects in Visual Studio 2013. The solution to this was to make a one time configuration so that Visual Studio is always run as administrator. 
In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility".
    1. select "Troubleshoot program"
    2. check "The program requires additional permissions"
    3. click "Next", click "Test the program..."
    4. wait for the program to launch
    5. click "Next"
    6. select "Yes, save these settings for this program"
    7. click "Close"
  • When trying to run my web application I got this error....

"configuring web for asp.net 4.0 failed. 
you must manually configure...."
    This was solved by running the command prompt as administrator and executing the following:



    Restarting visual studio and compiling solved the problem


    • The third problem occurred with the following problem shown for my website:

    The solution for this was to ensure that ASP.NET 4.5 was checked under Internet Information Services\World Wide Web Services\Application Development Features in Windows Features like below: