Windows service template missing?

2019-01-17 13:48发布

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?

9条回答
时光不老,我们不散
2楼-- · 2019-01-17 14:05

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

查看更多
\"骚年 ilove
3楼-- · 2019-01-17 14:06

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#.

查看更多
闹够了就滚
4楼-- · 2019-01-17 14:07

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:

查看更多
混吃等死
5楼-- · 2019-01-17 14:11

Screenshot described below

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

查看更多
Animai°情兽
6楼-- · 2019-01-17 14:11

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.

查看更多
三岁会撩人
7楼-- · 2019-01-17 14:21

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.

查看更多
登录 后发表回答