是否可以通过 Visual Studio Code 创建 Windows 服务? [英] Is it possible to create a Windows Service through Visual Studio Code?

查看:42
本文介绍了是否可以通过 Visual Studio Code 创建 Windows 服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Visual Studio 代码项目中,我为该项目生成了一个 .exe 文件,我正在尝试将我的 .exe 创建为 Windows 服务.

In my visual studio code project, I have generated an .exe file for the project and I'm trying create make my .exe as Windows Service.

来自这里这里,如果我没记错的话,这些解决方案看起来像是使用 Visual Studio 而不是 Visual Studio Code 完成的.是否可以通过 Visual Studio Code 创建窗口服务?

From here and here, if I'm not mistaken, these solutions look like done by using Visual Studio instead of Visual Studio Code. Is it possible to create a Window Service through Visual Studio Code?

推荐答案

你不能,

Visual Studio Code 是一个重新定义和优化的代码编辑器构建和调试现代 Web 和云应用程序.视觉的Studio Code 是免费的,可在您喜欢的平台上使用 - Linux,Mac OSX 和 Windows.

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, Mac OSX, and Windows.

它没有 Windows 服务

如果你想创建一个 Windows 服务,你必须使用 Visual Studio 或可以编译标准 .net Windows 应用程序的东西

If you wish to create a Windows service you will have to use Visual Studio or something that can compile standard .net Windows application

Ben Voigt 的精彩评论

你说得对,Visual Studio Code 没有服务,但那是因为它是编辑器而不是编译器.相同C# 编译器作为 .NET 运行时的一部分安装,可以构建 Windows服务.并且可以在VS Code中编辑windows服务代码

You're correct that Visual Studio Code doesn't have a concept of a service, but that's because it is an editor not a compiler. The same C# compiler installed as part of the .NET runtime, can build Windows Services. And you can edit the windows service code in VS Code

这篇关于是否可以通过 Visual Studio Code 创建 Windows 服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆