Sorry, I did not notice the main issue here. You cannot just write code in the declaration of a class, in order to compile it you need to move it to a method, maybe a constructor.
IObjectScope = ObjectScopeProvider1.ObjectScope()
'Your code here.
This example shows a class with a constructor wrapping the Scope in a using
clause so that it is disposed of when it is not needed anymore. I would suggest you to have a look at this msdn article
Hope this helps.
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Public Issue Tracking
system and vote to affect the priority of the items.