Skip to content
October 20, 2025

Pupli

  • .NET
    • .NET Core
    • ASP.NET
    • ASP.NET Blazor
    • ASP.NET MVC
    • ASP.NET Web APIs
    • ASP.NET Worker Services
    • async/await
    • AutoMapper
    • BenchmarkDotNet
    • C#
    • Dapper
    • DateTime
    • Dependency Injection
    • Entity Framework
    • EPPlus
    • FluentEmail
    • gRPC
    • Hangfire
    • HttpClient
    • Identity
    • Image Processing
    • MailKit
    • MassTransit
    • MediatR
    • MessagePipe
    • ML.NET
    • MongoDB
    • NuGet
    • Polly
    • PostgreSQL
    • Protobuf
    • Quartz.NET
    • Resources
    • RestSharp
    • Security
    • Selenium
    • Seq
    • Serilog
    • Sharp7
    • SharpVectors
    • SharpZipLib
    • SignalR
    • SOAP
    • StackExchange.Redis
    • String
    • Syncfusion
    • Windows
    • WPF
    • XML
  • About
  • C/C++
    • Qt
  • Database
    • Hibernate
    • MongoDB
    • MySQL
    • PostgreSQL
    • Redis
  • Electrical
    • PLC
  • Go
  • Java
    • Apache POI
    • Gradle
    • Groovy
    • Gson
    • Java
    • Joda
    • Kotlin
    • OkHttp
    • Quartz
    • RxJava
    • Spring
  • JavaScript
    • Express
    • JavaScript
    • Moment.js
    • Mongoose
    • Node.js
    • PM2
    • RxJS
    • Socket.IO
    • TypeScript
    • Yarn
  • Linux
    • Apache
    • Arch
    • Bash
    • EndeavourOS
    • Fedora
    • Git
    • Kali
    • Linux
    • Manjaro
    • Mint
    • Nginx
    • PDF
    • SSH
    • Tools
      • Certbot
      • cron
      • cURL
      • DNS
      • FFmpeg
      • GPG
      • grep
      • HAProxy
      • ip
      • iptables
      • Nmap
      • ProxyChains
      • rsync
      • sch
      • Superset
      • systemd
      • ufw
    • Ubuntu
    • VPN
  • Math
    • Formula
  • Microsoft
    • BAT
    • BI
    • Excel
    • PowerShell
    • Windows
      • DNS
    • Windows Server
    • WSL
  • Mobile
    • Android
    • Ionic
  • MQ
    • MQTT
    • RabbitMQ
  • Network
    • Cisco
    • Network+
  • Programming
    • Architectural Patterns
  • Python
    • Bokeh
    • Celery
    • Django
    • dnspython
    • Flask
    • Gunicorn
    • Network
    • NumPy
    • OpenCV
    • openpyxl
    • Pandas
    • PIL
    • psutil
    • PyInstaller
    • PyScreeze
    • PySide
    • pytesseract
    • Python
    • requests
    • Selenium
    • SQLAlchemy
    • SQLite
    • Telegram Bot
    • Virtualenv
    • Windows
  • Tools
    • GitHub Copilot
  • Web
    • Angular
    • Bootstrap
    • HTML
    • Next.js
    • PWA
    • React
    • Tailwind CSS
    • Vite
    • WordPress
    • XPath
    • CSS
Main Menu

Add a Worker Service to Web API Project

February 10, 2022 - by mahmood

Startup.cs

public void ConfigureServices(IServiceCollection services)
{
    services.AddHostedService<Worker>();  // the worker will run
    services.AddControllers();
}

References
https://stackoverflow.com/questions/58274763/hosting-web-api-in-net-core-worker-service-cannot-reference-iwebhostenvironme

Related

Taggedasp.net

Related Posts

Set Bypass Execution Policy Permanently for PowerShell

October 3, 2025October 3, 2025

useEffect Hook in React

September 23, 2025September 23, 2025

useState Hook in React

September 23, 2025September 23, 2025

Post navigation

Previous Article Enable DNS Over HTTPS on Windows 11
Next Article Remove DNF Repository Permanently

About mahmood

View all posts by mahmood →
Copyright © 2025 Pupli.
Powered by WordPress and HitMag.