Windows service template missing?

C#Visual Studio

C# Problem Overview


When I go to create a new project, the "Windows Service" template isn't there!

Can someone please either tell me where I can get it, or provide a download link to it?

C# Solutions


Solution 1 - C#

In Visual Studio 2015 I could not find the Windows Service template by selecting anything in left pane. Including c# -> Windows. However, when I query 'Windows Service' in the search bar at the top right corner, voilĂ , templates for c# or VB show up.

Solution 2 - C#

File > New > Project > Templates > Visual C# > Windows > Classic Desktop > Windows Service

Path to windows service template

The confusion is because Microsoft's own walkthrough doesn't give the full path to the project template: https://msdn.microsoft.com/en-us/library/zt39148a(v=vs.110).aspx

Solution 3 - C#

It it a bad documentation of Microsoft that causes confusion to many including me. Here is how: in the New Project you will need to DRILL DOWN by selecting Templates->Visual C#-> Windows Desktop (click on it!) then you will find "windows service" template on the right. see attachment.

I hope it helps.

Dunn.enter image description here

Solution 4 - C#

For Visual Studio 2010 (10.0):

You can navigate to your Visual Studio install directory and run devenv /installvstemplates as admin

OR

You can follow the documentation on how to create a windows service without the template here

OR

You can perform the steps below to reset your Visual Studio templates:

  1.               Please open `Windows Explorer`, and navigate to  `<Visual Studio Installation Path>\Common7\IDE` (by default is C:\Program Files \Microsoft Visual Studio 10.0\Common7\IDE);
    
  2.               Delete the `ItemTemplatesCache`, `ProjectTemplatesCache` folder;
    
  3.               Open `Visual Studio Command Prompt (2010)` under Start menu -> All Programs -> Microsoft Visual Studio 2010 -> Visual Studio Tools (run it with Administrator privilege: right-click the program -> Run as **administrator**);
    
  4.               Run the `vbexpress /InstallVSTemplates` switch
    
  5.               Run the `vbexpress /Setup` switch
    

OR

you can download template here.But oroblem is it is in vb.someone can convert it to c#.

Solution 5 - C#

Make sure you have installed the ".NET desktop development package.

1- Click on the "open visual studio installer"

enter image description here

2- Check .net desktop development then click on modify!

enter image description here

Solution 6 - C#

Screenshot described below

Go to File > New > Project; Templates > Visual C# > Windows > Classic Desktop; select Windows Service.

Solution 7 - C#

This is not a direct solution to your problem but you should have a look at [Topshelf][1] which allows you to create an application that can run as a console app and also install/uninstall itself as a service. I have used it several times and it is much easier to use than a traditional windows service with .Net

[1]: http://topshelf-project.com/ "Topshelf"

Solution 8 - C#

In addition to @SimperT 's answer : The same is the case with Visual Studio 2013 Just query Windows Service in the Top right search box and templates for Windows Service in VB and C# are displayed.

Hope it helped :)

screenshot:

Solution 9 - C#

For Visual Studio 2015 (14.0):

Navigate to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\ItemTemplates\CSharp\General\1033\Service and click Service.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionrshea0View Question on Stackoverflow
Solution 1 - C#SimperTView Answer on Stackoverflow
Solution 2 - C#cmartinView Answer on Stackoverflow
Solution 3 - C#DungView Answer on Stackoverflow
Solution 4 - C#prem30488View Answer on Stackoverflow
Solution 5 - C#user3505838View Answer on Stackoverflow
Solution 6 - C#Mohamed SalahView Answer on Stackoverflow
Solution 7 - C#Jürgen SteinblockView Answer on Stackoverflow
Solution 8 - C#user3188978View Answer on Stackoverflow
Solution 9 - C#ceoctrView Answer on Stackoverflow