简体   繁体   English

Windows服务是否需要.Net Runtime

[英]Does windows service require .Net Runtime

I'm creating a windows service in c# .net, and want to deploy it into a system where i don't have .net runtime. 我正在c#.net中创建一个Windows服务,并希望将其部署到我没有.net运行时的系统中。
My question is that is that service works without having .net runtime? 我的问题是服务是否在没有.net运行时的情况下工作? if no then how it work without having a runtime? 如果没有,那么没有运行时如何工作?

A Windows Service is just an executable that responds to certain calls by the Service Control Manager . Windows服务只是一个可执行文件,可响应服务控制管理器的某些调用。

So if you program the service's executable to run on .NET, the machine running the service has to have the .NET runtime installed. 因此,如果您将服务的可执行文件编程为在.NET上运行,则运行该服务的计算机必须安装.NET运行时。

The only alternative to having to install or embed/self-host the .NET runtime would be to not use .NET. 必须安装或嵌入/自托管.NET运行时的唯一选择是不使用.NET。

You need the .Net runtime for this. 你需要.Net运行时。 Otherwise, you'll have to write your code from scratch using c++ (Not managed c++) 否则,你将不得不使用c ++(非托管c ++)从头开始编写代码

Yes you need to have the .Net framework as the libraries and references used in the .net windows service might need the framework. 是的,你需要有.Net框架,因为.net windows服务中使用的库和引用可能需要框架。

if no then how it work without having a runtime? 如果没有,那么没有运行时如何工作?

You need to install the .Net framework on your system else there is no option to use the windows service on your system. 您需要在系统上安装.Net框架,否则您无法在系统上使用Windows服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM