I have a vuejs application that is created in vue-cli3 and ASP.Net WebAPI w/SignalR created in .Net Framework 4.6.x
I'm having an issue connecting to SignalR and it's throwing an error "Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server".
As per this link: Detected a connection attempt error, i should use signalR instead of @aspnet/signalr. But when i try to use it, now it throws a jquery reference error. Should i really use Jquery here? I'm already stuck for 2 days on this.
My Vue Component:
import { HubConnectionBuilder, LogLevel } from 'signalr'
// import { HubConnectionBuilder, LogLevel } from '@aspnet/signalr' <--- I already tried this,same error
created() {
const connection = new HubConnectionBuilder()
.withUrl('https://localhost:44356/chat-hub')
.configureLogging(LogLevel.Information)
.build()
connection.start()
}
My Startup.cs
public void Configuration(IAppBuilder app)
{
app.Map("/chat-hub",
x =>
{
x.UseCors(CorsOptions.AllowAll);
var hubConfig = new HubConfiguration
{
};
x.RunSignalR(hubConfig);
}
);
app.MapSignalR();
}