@@ -49,7 +49,7 @@ public static void Execute(IServiceCollection services, IConfiguration configura
4949 // Add the SentimentSink
5050 //services.AddSingleton<Fritz.Chatbot.Commands.SentimentSink>();
5151
52- services . AddSingleton < IHostedService , FritzBot > ( ) ;
52+ services . AddHostedService < FritzBot > ( ) ;
5353
5454 services . AddSingleton ( new GitHubClient ( new ProductHeaderValue ( "Fritz.StreamTools" ) ) ) ;
5555 FritzBot . RegisterCommands ( services ) ;
@@ -119,6 +119,7 @@ private static void AddStreamingServices(this IServiceCollection services, IConf
119119 c => ! bool . TryParse ( c [ "StreamServices:Fake:Enabled" ] , out var enabled ) || ! enabled ) ; // Test to disable
120120
121121 services . AddSingleton < StreamService > ( ) ;
122+
122123 }
123124
124125 /// <summary>
@@ -133,7 +134,7 @@ private static void AddStreamService<TStreamService>(this IServiceCollection ser
133134 IConfiguration configuration ,
134135 Func < IConfiguration , ILoggerFactory , TStreamService > factory ,
135136 Func < IConfiguration , bool > isDisabled )
136- where TStreamService : class , IStreamService
137+ where TStreamService : class , IStreamService , IHostedService
137138 {
138139
139140 // Don't configure this service if it is disabled
@@ -174,6 +175,8 @@ private static void AddAspNetFeatures(this IServiceCollection services)
174175
175176 } ) . AddMessagePackProtocol ( ) ;
176177
178+ services . AddRazorPages ( ) ;
179+
177180 services . AddMvc ( )
178181 . SetCompatibilityVersion ( CompatibilityVersion . Version_3_0 ) ;
179182
@@ -182,7 +185,9 @@ private static void AddAspNetFeatures(this IServiceCollection services)
182185 private static void RegisterTwitchPubSub ( this IServiceCollection services ) {
183186
184187 services . AddSingleton < Twitch . PubSub . Proxy > ( ) ;
188+
185189 services . AddHostedService < TwitchPubSubService > ( ) ;
190+
186191 //var provider = services.BuildServiceProvider();
187192
188193 //var pubSub = new TwitchPubSubService(
0 commit comments