I just modified our module for ArcGIS Pro v3.3 (excerpt of Config.daml below) to auto-load.
<modules>
<insertModule id="WREdit_Module" className="WREditModule" autoLoad="true" caption="WREdit">
<tabs>
Despite this, the static constructor doesn't run any earlier than it previously did--for example, until I click a button defined within the module.
I also recently created a non-static constructor and overloads of Initialize() & Uninitialize().
public WrEditModule()
{
LogExceptionToFile(new Exception("ctor"));
Log.Information("ctor");
_wrEditLauncherPipeServer = GetDependency<WrEditLauncherPipeServer>();
_wrEditLauncherPipeServer.Run();
}
protected override bool Initialize() //Called when the Module is initialized.
{
LogExceptionToFile(new Exception("Initialize"));
Log.Information("init");
_wrEditLauncherPipeServer = new WrEditLauncherPipeServer();
_wrEditLauncherPipeServer.Run();
return base.Initialize();
}
protected override void Uninitialize() //Called when the Module is shut down.
{
LogExceptionToFile(new Exception("Uninitialize"));
Log.Information("uninit");
_wrEditLauncherPipeServer.Stop(); // Stop the pipe server
base.Uninitialize();
}
But none of that stuff ever happens. Everything we've put in there so far is static (following the convention described in the doc), but I'd expect that an API documented with non-static members would . . . y'know . . . instantiate an object at some point. What am I missing?
I could handle this statically if necessary, but I need to run the `_wrEditLauncherPipeServer.Stop()` method before ArcGIS Pro is closed. How can I ensure that happens in a static context?