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:23

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

查看更多
【Aperson】
3楼-- · 2019-01-17 14:25

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

查看更多
不美不萌又怎样
4楼-- · 2019-01-17 14:27

This is not a direct solution to your problem but you should have a look at Topshelf 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

查看更多
登录 后发表回答