using (var scope = _container.BeginLifetimeScope(MatchingScopeLifetimeTags.RequestLifetimeScopeTag)){ ...现在,在我的代码中,我找到了其他几个需要解析MyTestService的类,这些类目前导致了一个消息No scope with a Tag matching
我了解局部变量的作用域,所以必须有实例变量才能运行代码,否则我会得到一个NameErrorclass Example @scope = "This is the scopeof the class itself"
p @scope ex.hello 看起来不能访问预定义的实例变量这应该与实例化有关,但我不知道确切的原因。