Skip to main content

Dev Loop — dev.bat

The inner-loop workflow for working on the plugin. Hot-reload style: make changes, run one command, get a fully-booted AutoCount with FormWmsSync already open.

What dev.bat does

  1. MSBuild-ds WmsSyncHub.csproj in Debug.
  2. Copies WmsSyncHub.dll + its dependencies to the ShadowMain output folder.
  3. Launches WMSSyncHubShadowMain.exe.

What WMSSyncHubShadowMain.exe does:

  1. Reads WMSSyncHubShadowMain\App.config for DB connection + AutoCount login credentials.
  2. Boots the AutoCount runtime (Application.Run(new Shell())).
  3. Auto-logs in using the config credentials.
  4. Calls into WmsSyncHub.dll and opens FormWmsSync directly — skipping the Plug-in Manager entirely.

The result: from code change to usable UI in ~15 seconds, zero clicks.

How it differs from production AutoCount load

ProductionInner loop
.app installed via Plug-in Manager.dll copied to ShadowMain output
User clicks menu entry under ToolsForm opens on startup
PluginMain.Initialize() called by AutoCount hostShadowMain calls FormWmsSync.ShowDialog() directly
Login via AutoCount login dialogLogin credentials read from App.config

This means inner-loop testing skips two real-world code paths:

  • The PluginMain ctor (which asserts SetMinimumAccountingVersionRequired / SetDevExpressComponentVersionRequired).
  • The AutoCount menu-wiring and permissions resolution.

If you are changing anything in those paths, test with the outer loop too — see Outer Loop.

The dev database

Points at whatever is in WMSSyncHubShadowMain\App.config. Today's default:

<connectionStrings>
<add name="Default" connectionString="Server=localhost,1433;Database=AED_ATPLUGIN001;..." />
</connectionStrings>

AED_ATPLUGIN001 is shared with the ATP plugin for convenience. If WMS grows its own account book, update the config — but do not commit personal credentials.

Starting and stopping the API

The companion API is a separate process and is not started by dev.bat. Run it in another shell:

cd WmsSyncHubApi
dotnet run # or run the built .exe

On shutdown, just close the console window or Ctrl-C. The workers handle cancellation gracefully via the CancellationWorker base class.

Rebuild loop

# Terminal 1 — the API
cd WmsSyncHubApi
dotnet run

# Terminal 2 — the plugin (re-runs every time you change code)
cd ..
.\dev.bat

Each time you edit C# code:

  • Plugin — close the FormWmsSync window, re-run dev.bat.
  • API — Ctrl-C the console, dotnet run again.

Neither needs an AutoCount restart.

Caution

:::caution ShadowMain keeps credentials in App.config WMSSyncHubShadowMain\App.config is in source control but the real credentials are local. Before committing, double-check you have not pasted a real customer password into the config file. The canonical template ships with placeholders. :::

:::tip When the UI hangs on launch Usually means the API is not running and the plugin is trying to hit http://localhost:5006/api/ping during startup. Either start the API or click through the "ping failed" warning. :::