If the below SomeClass does not have an empty constructor then SomeClass resolves fine, but with an empty constructor it fails, so what is the right way to resolve it with Unity container?
IUnityContainer container = new UnityContainer();
container.Resolve<SomeClass>(); // Does not work with empty constructor
class SomeClass
{
SomeClass()
{
Console.WriteLine("SomeClass created");
}
}
Your constructor is not public. Unity does not look for private or protected constructors.