Question: Recently I received a question on how to avoid exposing commands in the custom plug-in when the license verification fails.
Answer: One of the procedure to achieve this requirement is to do license verification in IExtensionApplication.Initialize() and throwing an exception if license verification fails. After throwing exception, none of the commands in plug-in will be available for the user.
void IExtensionApplication.Initialize() { //your check... //throw LoadFailed error... throw new Autodesk.AutoCAD.Runtime.Exception( Autodesk.AutoCAD.Runtime.ErrorStatus.LoadFailed); }