SignalR cross domain

Hi, how are you? I hope that you´re good. I need your help to make a signalR cross domain with a web application and console application, the web applicacion has the signalR implementation but the console aaplication is totally different and it function as client about the web app.
I could make the web application hubconnection in the webconsole but when I invoked the method, it generated the next error:

The web application has a hub and his frontend controller I call the notify

I need your help, this is a job investigation for the software company where I work it.
I put the console application about signalR:

using Microsoft.AspNet.SignalR.Client;
using Microsoft.Owin.Cors;
using Owin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace ConsolaCrossSignalR
{
    public class Program
    {
        static void Main(string[] args)
        {
            var opcion = "";

            var connection = new HubConnection(
                "http://localhost/ViewParking/signalr/hubs", 
                useDefaultUrl: false
            );
            var hub = connection.CreateHubProxy("NotificacionHub");
            
            connection.Start();

            while (!opcion.Equals("N", StringComparison.OrdinalIgnoreCase))
            {
                Console.ForegroundColor = ConsoleColor.Gray;
                Console.Write("¿Desea agregar una nueva novedad (Y - Sí, N - No)?: ");
                opcion = Console.ReadLine();

                if (opcion.Equals("Y", StringComparison.OrdinalIgnoreCase))
                {
                    Console.Write("\n* Ingrese un comentario: ");
                    var comentario = Console.ReadLine();

                    var novedad = new LogNovedades
                    {
                        UsuarioId = 2,
                        Comentarios = comentario,
                        ComentariosConFormato = "<p>Esta es una prueba con signalR cruzado, fecha: "
                            + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss")  +"</p>"
                    };

                    var dal = new DALNovedad();
                    var retorno = dal.AgregarNovedad(novedad);

                    if (retorno.Exito)
                    {
                        hub.Invoke("Notify").Wait();
                    }

                    Console.ForegroundColor = ConsoleColor.DarkGreen;
                    Console.WriteLine("\n--- Novedad Agregada ---x\n");
                }
                else if (                    
                    !opcion.Equals("Y", StringComparison.OrdinalIgnoreCase) && 
                    !opcion.Equals("N", StringComparison.OrdinalIgnoreCase))
                {
                    Console.ForegroundColor = ConsoleColor.Red;
                    Console.WriteLine("\n--- ERROR!! Opción equivocada ---x\n");
                }
                else
                {
                    Console.ForegroundColor = ConsoleColor.Blue;
                    Console.WriteLine("\n--- Gracias por usar nuestro sistema ---x\n");                    
                }
            }

            Thread.Sleep(2000);
        }
    }

    class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.UseCors(CorsOptions.AllowAll);
            app.MapSignalR();
        }
    }
}

I wait your answers and greetings.
Thank you.

I resolved the trouble, all that i needed it was a implementation of server-side (web application) and found it.

Thanks for all.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.