We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's not the same as unitycontainer/container#160, but perhaps it is related to each other.
Compile and run the following code for .NET Core (I tried for 2.1) and Framework (tried for 4.7.2). The output is different.
.NET Core
Framework
class Program { static void Main(string[] args) { var container = new UnityContainer() .AddNewExtension<Interception>() .RegisterType<Foo>() .RegisterType<IBar, Bar>(); var child = container.CreateChildContainer() .RegisterType<IFoo, Foo>(new ContainerControlledLifetimeManager()) .RegisterType<Foo>(new ContainerControlledLifetimeManager()); var registrations = child.Registrations.Where(r => r.RegisteredType == typeof(Foo)); foreach (var registration in registrations) { Console.WriteLine( $"{registration.RegisteredType.Name}->" + $"{registration.MappedToType.Name}" + $"[{registration.LifetimeManager}]"); } } public interface IFoo { } public class Foo : IFoo { } public interface IBar { } public class Bar : Foo, IBar { } }
For Framework version the output is
Foo->Foo[Lifetime:PerContainer]
But for .NET Core version is:
Foo->Foo[Lifetime:Transient] Foo->Foo[Lifetime:PerContainer]
For .NET Core must be the same registration as for Framework. The transient registration is obviously wrong.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
It's not the same as unitycontainer/container#160, but perhaps it is related to each other.
How to reproduce
Compile and run the following code for
.NET Core
(I tried for 2.1) andFramework
(tried for 4.7.2). The output is different.For Framework version the output is
But for .NET Core version is:
Expected behavior
For
.NET Core
must be the same registration as forFramework
. The transient registration is obviously wrong.The text was updated successfully, but these errors were encountered: