简体   繁体   English

C# Blazor 项目作为 Windows 服务运行

[英]C# Blazor project running as Windows Service

I'm pretty new to this.我对此很陌生。 I have a c# blazor project which is using SQLite Database on.Net6.0 I'm trying to turn this into a windows service, so I can run it on a windows server (Win 10).我有一个 c# blazor 项目,它使用 SQLite 数据库 on.Net6.0 我试图将其转换为 windows 服务,因此我可以在 windows 服务器(Win 10)上运行它。 I followed steps here我按照这里的步骤

but when I try running the service via "Windows Services" on my local computer, I get this error: Windows could not start the service on Local Computer.但是当我尝试在我的本地计算机上通过“Windows 服务”运行该服务时,出现此错误:Windows 无法在本地计算机上启动该服务。 Error 5:Access is denied.错误五:访问被拒绝。

and on the windows server it starts and immediately stops.在 windows 服务器上它启动并立即停止。 I checked Event Viewer and there wasn't any details about why that's it.我检查了事件查看器,没有任何关于为什么会这样的详细信息。

Do you if I need to do more stuff for it to run?如果我需要做更多的事情才能让它运行,你会吗? specially DB wise?特别是数据库明智? I can't find good info on inte.net:(我在 inte.net 上找不到好的信息:(

I fixed it.我修好了它。 So, follow the link and it should work.所以,点击链接,它应该可以工作。 I had some other problems with IP and Port.我在使用 IP 和端口时遇到了一些其他问题。 and just that you don't need to change anything for your DB.而且您不需要为数据库更改任何内容。 You probably need to add an automatic DB migration which you can find it here .您可能需要添加自动数据库迁移,您可以在此处找到它。

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

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