I want to incorporate SignalR on my project but I can't I have an error when I add the line app.MapSignalR() in the Startup class. Here is the StartUp class:
public class Startup
{
public Startup(IConfiguration configuration{...}
public IConfiguration Configuration { get; }
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{...}
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
app.UseDatabaseErrorPage();
}
else
{
app.UseExceptionHandler("/Home/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseCookiePolicy();
app.UseAuthentication();
app.MapSignalR(); // ERROR - IApplicaionBuilder dos not contain a definition MapSignalR() and the best extension method overload ' OwinExtensios.MapSignalR(IAppBuilder)' requires a receiver of type 'IAppBuilder'
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
I already added 'using Owin;' and it still doesn't work. What should I do?