简体   繁体   English

"Grpc:C# 服务器作为 Windows 服务是否可能?"

[英]Grpc: C# server as a Windows Service is it possible?

Im trying to pass the source code of a C# Grpc server into a Windows Service Project.我试图将 C# Grpc 服务器的源代码传递到 Windows 服务项目中。 Following these steps<\/a> but when I execute InstallUtil MyService.exe the process stops indicating遵循这些步骤<\/a>,但是当我执行 InstallUtil MyService.exe 时,进程停止指示

System.Reflection.ReflectionTypeLoadException: No se pueden cargar uno o varios
tipos requeridos. Recupere la propiedad LoaderExceptions para obtener más información.

Try setting the Copy Local attribute of project's references to true. 尝试将项目引用的“本地复制”属性设置为true。

More info here: Error message 'Unable to load one or more of the requested types. 此处有更多信息: 错误消息“无法加载一种或多种请求的类型。 Retrieve the LoaderExceptions property for more information.' 检索LoaderExceptions属性以获取更多信息。

you need to use CS command as specified in following link because this is .net Core application.您需要使用以下链接中指定的 CS 命令,因为这是 .net Core 应用程序。

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/sc-create

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

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