The problem is most likely that your assembly is being loaded and an exception is occurring in the code that executes when the assembly is loaded. If your assembly contains an IExtensionApplication, the exception is most likely occurring in the Initialize() method, or in code that's called from it.
The reason that you might not get an exception when you use the NETLOAD command is because it runs in a different execution context then the one that loads your extension at startup (NETLOAD runs in the document context, while the auto-loader runs in the application context).
To ensure that your startup code always runs in the application context, you can use an Idle event handler to execute the initialization code. When you do that, your initialization code always runs in the same execution context, regardless of how your extension is loaded. You should also enclose all startup code in in a try{} block, followed by a catch{} block that catches any exception that's thrown and displays a message on the command line along with the exception stack Trace.
Here is a basic example IExtensionApplication that does what I describe above:
public class MyApplication : IExtensionApplication
{
public void Initialize()
{
Application.Idle += OnIdle;
}
private void OnIdle(object sender, EventArgs e)
{
Document doc = Application.DocumentManager.MdiActiveDocument;
if(doc != null)
{
Application.Idle -= OnIdle;
try
{
}
catch(System.Exception ex)
{
doc.Editor.WriteMessage($"\nError: {ex.ToString()}\n");
}
}
}
public void Terminate()
{
}
}