HangfireIO / HangfireIO/Hangfire

"AuthenticationDescription is ambiguous" exception

Open
#1,998 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.1k
Forks
1.8k
Avg merge
1h 19m
Merged PRs (30d)
1

Description

When I reference and configure HF in my web application, when I run it, I get the following exception:

_HttpException (0x80004005): The type 'Microsoft.Owin.Security.AuthenticationDescription' is ambiguous: it could come from assembly
'Hangfire.Core.DLL' or from assembly 'Microsoft.Owin.DLL'. Please specify the assembly explicitly in the type name.
System.Web.UI.Util.GetTypeFromAssemblies(IEnumerable assemblies, String typeName, Boolean ignoreCase) +434
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +252
System.Web.UI.WebControls.DataBoundControlHelper.EnableDynamicData(INamingContainer control, String entityTypeName) +275
System.Web.UI.WebControls.ListView.OnInit(EventArgs e) +172
System.Web.UI.Control.InitRecursive(Control namingContainer) +457
System.Web.UI.Control.InitRecursive(Control namingContainer) +224
System.Web.UI.Control.InitRecursive(Control namingContainer) +224
System.Web.UI.Control.InitRecursive(Control namingContainer) +224
System.Web.UI.Control.InitRecursive(Control namingContainer) +224
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1184_

Web application description:
Asp.Net WebForms, .Net Framework 4.6.2, Current HF libraries.
Application uses Startup.cs and references Microsoft.Owin, Microsoft.Owin.Host.SystemWeb assemblies for its own purposes.

My application explicitly references Microsoft.Owin.Security.AuthenticationDescription type (from Microsoft.Owin assembly) in one place - the ascx user control and its ascx.cs behind code. It seems when the application is running user control, it looks for the **Microsoft.Owin.Security.AuthenticationDescription** class and finds two, the first in the Microsoft.Owin assembly and the second in the Hangfire.Core assembly, both with the same namespace! Therefore, an error occurs.
I don't know if it's a good idea to name a class in a Hangfire assembly as **Microsoft.Owin.Security**.AuthenticationDescription, even though it has an internal modifier.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.