c# - SignalR Incorrect Content-Type from javascript call -


when make call signalr (cross-domain) server javascript fails call telling oops.

500 internal server error system.invalidoperationexception incorrect content-type: @ microsoft.aspnet.http.features.internal.formfeature.d__12.movenext() @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.configuredtaskawaitable.configuredtaskawaiter.getresult() @ microsoft.aspnet.signalr.taskawaiterhelper.preservecultureawaiter.getresult() @ microsoft.aspnet.signalr.transports.longpollingtransport.d__28.movenext() @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.configuredtaskawaitable.configuredtaskawaiter.getresult() @ microsoft.aspnet.signalr.taskawaiterhelper.preservecultureawaiter.getresult() @ microsoft.aspnet.signalr.transports.forevertransport.d__29.movenext() @ system.runtime.compilerservices.taskawaiter.throwfornonsuccess(task task) @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.configuredtaskawaitable.configuredtaskawaiter.getresult() @ microsoft.aspnet.signalr.taskawaiterhelper.preservecultureawaiter.getresult()

<script type="text/javascript" src="~/lib/jquery/jquery.signalr-2.0.3.js"></script> <script type="text/javascript" src="~/lib/jquery/jquery.signalr.hubs.js"></script>  <script type="text/javascript">     $(function () {         /*signalr*/         actividadsignalr = $.connection.cross2businesshub;         if (actividadsignalr != undefined) {             actividadsignalr.on('respuestaactividad', function (id) {                 alert("respuesta recibida");             });         }         /**fin signalr*/         $('#table_@guid').customdatatable();          $('.pausarcontinuaractividad').on('click', function (e) {              var controlestadoactividad = $(this);             if (controlestadoactividad.hasclass('disabled'))                 return;             var estadoactividaddiv = controlestadoactividad.parent().parent().parent().find('.estadoactividad');             var estadoactividad = estadoactividaddiv.html();             estadoactividaddiv.loading(2);             controlestadoactividad.parent().find('a').addclass('disabled');              $.connection.hub.start({ transport: activetransport, jsonp: true }, function () {                 actividadsignalr.server.notificarcambioestadoactividad(controlestadoactividad.attr('data-identificacion'), controlestadoactividad.attr('data-evento'))                     .done(function () {                         alert("respuesta enviada");                     }).fail(function () {                         notify('informaciĆ³n', 'no se puede pausar la actividad.', { hpos: 'center', showcloseonhover: false });                         estadoactividaddiv.html(estadoactividad);                         controlestadoactividad.parent().find('a').removeclass('disabled');                     });             });         });          $('.cancelaractividad').on('click', function (e) {          });     }); </script> 

looks using aspnet v5 - bug. bug says happens long polling may work if try different transport.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -