Skip to content

Azure sample gives error when calling $.connection.hub.start() #70

@MrYossu

Description

@MrYossu

I followed the local chat room sample, and it worked fine.

I then tried modifying it to use Azure, as shown in the Azure chat room sample.

My changes were to modify Startup.cs to call app.MapAzureSignalR(GetType().FullName) instead of app.MapSignalR() and to add the connection string to my web.config file (see below).

However, this does not work. When I load the page and enter my name, I see the following error in the browser's console window...

app.MapSignalR()Uncaught TypeError: Cannot read property 'toLowerCase' of undefined
at hubConnection.fn.init. (jquery.signalR-2.4.0.js:2997)
at hubConnection.fn.init. (jquery.signalR-2.4.0.js:877)
at hubConnection.fn.init.handle (jquery-1.6.4.min.js:3)
at hubConnection.fn.init.k (jquery-1.6.4.min.js:2)
at Object.trigger (jquery-1.6.4.min.js:3)
at init.triggerHandler (jquery-1.6.4.min.js:3)
at Object.triggerReceived (jquery.signalR-2.4.0.js:1599)
at Object. (jquery.signalR-2.4.0.js:1634)
at Function.each (jquery-1.6.4.min.js:2)
at Object.processMessages (jquery.signalR-2.4.0.js:1633)

This seems to happen in the call to $.connection.hub.start()

Anyone any ideas what's gone wrong? My full web.config (with sensitive data removed) is shown below...

<?xml version="1.0"
      encoding="utf-8"?>

<configuration>
  <connectionStrings>
    <add name="Azure:SignalR:ConnectionString"
         connectionString="Endpoint=https://something.service.signalr.net;AccessKey=MyAccessKey=;Version=1.0;" />
  </connectionStrings>

  <system.web>
    <compilation debug="true"
                 targetFramework="4.6.1" />
    <httpRuntime targetFramework="4.5" />
  </system.web>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Newtonsoft.Json"
                          publicKeyToken="30ad4fe6b2a6aeed"
                          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-11.0.0.0"
                         newVersion="11.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Buffers"
                          publicKeyToken="cc7b13ffcd2ddd51"
                          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.3.0"
                         newVersion="4.0.3.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks.Extensions"
                          publicKeyToken="cc7b13ffcd2ddd51"
                          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0"
                         newVersion="4.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.ValueTuple"
                          publicKeyToken="cc7b13ffcd2ddd51"
                          culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.2.0"
                         newVersion="4.0.2.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp"
                extension=".cs"
                type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                warningLevel="4"
                compilerOptions="/langversion:default /nowarn:1659;1699;1701" />
      <compiler language="vb;vbs;visualbasic;vbscript"
                extension=".vb"
                type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
                warningLevel="4"
                compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+" />
    </compilers>
  </system.codedom>
</configuration>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions