Last post Jul 30, 2015 06:11 AM by Boban-mk
Jul 30, 2015 02:41 AM|Boban-mk|LINK
I have a requirement to have two web apps (one site with two different skins) to work with signalR.
Apps are opening fine with the configuration in the ServiceDefinition.csdef where the second web app have hostHeader. SignalR is working on the main web site but i have problem setting up the signalR on the second web site.
1. If i don't change the url property on the connection for the second web site then no errors in the browser but signalR won't work at all. Debugging it i can see that the signalR configuration is executed but the Hubs are not instanced. The main web app
is working fine, and hubs are instanced fine. All the code is common for both and is extracted in a separate class library. The C# code left in both web apps are the Global.asax.cs and the Startup configuration for SignalR.
SignalR XMLHttpRequest cannot load... The 'Access-Control-Allow-Origin' header contains multiple values.
Anybody got into same problem or have an idea how to solve it?
Jul 30, 2015 03:57 AM|progi|LINK
I remember me that I had something like that. There I had multiple configurations for the header. Are you shure that you do not have multiple settings for the "cross domain issues" ?
Jul 30, 2015 05:02 AM|Boban-mk|LINK
I have these settings in the main app web.config:
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
I had also tried with http://www.mydomainname.com for the first setting value.
The startup code for singlaR is:
public void Configuration(IAppBuilder app)
var serviceBusConnectionString = "my service bus conection";
app.Map("/signalr", map =>
var hubConfiguration = new HubConfiguration
Configuration in the ServiceDefinition.csdef is:
<Binding name="Endpoint1" endpointName="Endpoint1" />
<Site name="Web2" physicalDirectory="..\..\Sites\ubetPro.UI.Web.Tote">
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="www.mydomainname.com" />
Jul 30, 2015 05:09 AM|progi|LINK
Jul 30, 2015 06:11 AM|Boban-mk|LINK
Thanks, that was it.
I was fighting with cross domain issue first, and then changed the configuration on the signalr start with the cors specifics.