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
- MSBuild-ds
WmsSyncHub.csprojinDebug. - Copies
WmsSyncHub.dll+ its dependencies to the ShadowMain output folder. - Launches
WMSSyncHubShadowMain.exe.
What WMSSyncHubShadowMain.exe does:
- Reads
WMSSyncHubShadowMain\App.configfor DB connection + AutoCount login credentials. - Boots the AutoCount runtime (
Application.Run(new Shell())). - Auto-logs in using the config credentials.
- Calls into
WmsSyncHub.dlland opensFormWmsSyncdirectly — 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
| Production | Inner loop |
|---|---|
.app installed via Plug-in Manager | .dll copied to ShadowMain output |
| User clicks menu entry under Tools | Form opens on startup |
PluginMain.Initialize() called by AutoCount host | ShadowMain calls FormWmsSync.ShowDialog() directly |
| Login via AutoCount login dialog | Login credentials read from App.config |
This means inner-loop testing skips two real-world code paths:
- The
PluginMainctor (which assertsSetMinimumAccountingVersionRequired/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
FormWmsSyncwindow, re-rundev.bat. - API — Ctrl-C the console,
dotnet runagain.
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.
:::