I need to force the use of \"using\" to dispose a new instance of a class.
public class MyClass : IDisposable
{
...
}
using(MyClass obj = new MyClass())
No it is not possible. Now what you can do is call the dispose method in the finalizer of the class (and then you can suppress the use of it if they do actually call the dispose method). That way it will fire if not done explicitly in code.
This link will show you how to implement the finalizer / dispose pattern:
http://www.devx.com/dotnet/Article/33167