Giter Site home page Giter Site logo

Comments (8)

PeterKottas avatar PeterKottas commented on July 30, 2024

Hi there, this doesn't sound like something that would be easily doable. The way this works is very different from topshelf. This is quite a small lib currently focused on functionality and features over specific syntax when running the service. It would obviously be doable and if you want, feel free to fork it up and I'll be happy to review changes, but atm, this is probably not something I would look into. You will still be able to deploy using powershell but yeah, the api is different to topshelf so your deploy scripts would have to handle that atm.

from dotnetcore.windowsservice.

andymac4182 avatar andymac4182 commented on July 30, 2024

@kmcgain I have this working with sc.exe using a standalone app. I am sure you could get the same working with New-Service

from dotnetcore.windowsservice.

kmcgain avatar kmcgain commented on July 30, 2024

Hi, thanks for the feedback. It turns out it does work fine using New-Service.
I needed to specify -BinaryPathName "path_to_exe action:run"

By missing the action:run in bin path it fails to run (presumably running the console app and not providing windows service callbacks).

Is it worth updating the doc page with an example of this?

from dotnetcore.windowsservice.

andymac4182 avatar andymac4182 commented on July 30, 2024

@kmcgain It would be worth providing a PR to the README covering this personally. It was a little frustrating to find when I did this for myself.

from dotnetcore.windowsservice.

kmcgain avatar kmcgain commented on July 30, 2024

#18

from dotnetcore.windowsservice.

PeterKottas avatar PeterKottas commented on July 30, 2024

Hi gents, apologies, been a busy week, I only got to this now. Glad it worked for you guys after all! Good job helping out @andymac4182 and thanks for the pr @kmcgain .

from dotnetcore.windowsservice.

gitfortee avatar gitfortee commented on July 30, 2024

Hello there. I need to deploy a windows service to an 2008 R2 machine.

I need to specify a user account and password for the service to run using.

This is the powershell script.

New-Service -Name "MyServiceName" -BinaryPathName ".\Consoleapp.dll action:run username:domain\username password:passwordstring" -StartupType Automatic

But i get

Windows could not start the MyServiceName service on Local Computer.
Error 2: The system cannot find the file specified.

I looked up the service properties to see the path to executable has ".\Consoleapp.dll action:run username:domain\username password:passwordstring"

so how should my powershell command look like.?

from dotnetcore.windowsservice.

gitfortee avatar gitfortee commented on July 30, 2024

@PeterKottas Ok. I figured out the right script that i can use to install the service. But now i get an error like this.. and i do not see any logs. any idea what is going wrong..?

A timeout was reached (30000 milliseconds) while waiting for the "MyServiceName" service to connect.

from dotnetcore.windowsservice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.