Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AppContextSwitchOverrides doesn't work, found 3 DNS claims in authorization context

I get "found 3 DNS claims in authorization context" in my role on azure. I found a solution here but it doesn't work. At first I added the config setting

<AppContextSwitchOverrides value="Switch.System.IdentityModel.DisableMultipleDNSEntriesInSANCertificate=true" />

It doesn't help.

Then I tried with setting by code

    public override bool OnStart()
    {
        AppContext.SetSwitch("Switch.System.IdentityModel.DisableMul‌​tipleDNSEntriesInSAN‌​Certificate", true);

        return base.OnStart();
    }

The result is the same. I have installed the service bus version 2.7.6 and .net 4.6.2. I cannot update the service bus to a higher version because signalR won't work with a service bus version >= 3.

like image 931
vborutenko Avatar asked Oct 17 '22 14:10

vborutenko


2 Answers

In my case the problem was in Microsoft.AspNet.SignalR.ServiceBus NuGet incompatibility with .NET 4.7.1 so that I had to install Microsoft.AspNet.SignalR.ServiceBus3 instead

like image 133
Andrii Avatar answered Oct 29 '22 20:10

Andrii


I create a sample using the Service Bus backplane to distribute messages to each role instance, which works fine on my side. Please refer to it and test it on your side.

configure the backplane in Startup.cs class

public void Configuration(IAppBuilder app)
{
    string connectionString = "<Service Bus connection string>";
    GlobalHost.DependencyResolver.UseServiceBus(new ServiceBusScaleoutConfiguration(connectionString, "FeHanSignalRChat") { TopicCount = 3 });

    app.MapSignalR();
}

packages.config

<?xml version="1.0" encoding="utf-8"?>
<packages>
    <package id="Antlr" version="3.4.1.9004" targetFramework="net462" />
    <package id="bootstrap" version="3.0.0" targetFramework="net462" />
    <package id="jQuery" version="1.10.2" targetFramework="net462" />
    <package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.SignalR" version="2.2.1" targetFramework="net462" />
    <package id="Microsoft.AspNet.SignalR.Core" version="2.2.1" targetFramework="net462" />
    <package id="Microsoft.AspNet.SignalR.JS" version="2.2.1" targetFramework="net462" />
    <package id="Microsoft.AspNet.SignalR.ServiceBus" version="2.2.1" targetFramework="net462" />
    <package id="Microsoft.AspNet.SignalR.SystemWeb" version="2.2.1" targetFramework="net462" />
    <package id="Microsoft.AspNet.Web.Optimization" version="1.1.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebApi" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebApi.HelpPage" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebApi.WebHost" version="5.2.3" targetFramework="net462" />
    <package id="Microsoft.AspNet.WebPages" version="3.2.3" targetFramework="net462" />
    <package id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="1.0.0" targetFramework="net462" />
    <package id="Microsoft.Net.Compilers" version="1.0.0" targetFramework="net462" developmentDependency="true" />
    <package id="Microsoft.Owin" version="2.1.0" targetFramework="net462" />
    <package id="Microsoft.Owin.Host.SystemWeb" version="2.1.0" targetFramework="net462" />
    <package id="Microsoft.Owin.Security" version="2.1.0" targetFramework="net462" />
    <package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net462" />
    <package id="Microsoft.WindowsAzure.ConfigurationManager" version="2.0.0.0" targetFramework="net462" />
    <package id="Modernizr" version="2.6.2" targetFramework="net462" />
    <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net462" />
    <package id="Owin" version="1.0" targetFramework="net462" />
    <package id="Respond" version="1.2.0" targetFramework="net462" />
    <package id="WebGrease" version="1.5.2" targetFramework="net462" />
    <package id="WindowsAzure.ServiceBus" version="2.1.0.0" targetFramework="net462" />
</packages>

Messages could be distributed fine, and on Azure portal, I could find topics and subscriptions are created.

enter image description here

like image 20
Fei Han Avatar answered Oct 29 '22 20:10

Fei Han