无法解析非可选依赖项

Could not resolve non-optional dependency

我有这样的界面:

public interface IdFactory
{
     Id Create(Guid userId);
}

而温莎城堡的定义是这样的:

container.Register(Castle.MicroKernel.Registration
    .Component.For<Id>().ImplementedBy<Id>().LifeStyle.Transient);

调用代码如下所示:

 var ID = IDFactory.Create(new Guid(userId));

我得到的错误是:

Castle.MicroKernel.Resolvers.DependencyResolverException: 'Could not resolve non-optional dependency for 'Id' (Id). Parameter 'id' type 'System.Guid''

这里有什么问题?我必须在 Castle Windsor 中配置 System.Guid 吗?

工厂方法的参数名和解析的class构造函数的参数名必须相同:

public class Id
{
    public Id(Guid userId /*not - Guid id*/)
    {
    }
}