-
Notifications
You must be signed in to change notification settings - Fork 14
Migrating From REGEN.BAT

If you’ve been using the regen.bat file to control code generation for your Harmony Core solution, you can easily move to the Harmony Core CLI Tool. The CLI Tool replaces regen.bat and provides a graphical user interface (GUI)for configuring and running code generation. With the CLI Tool, you can
- configure code generation options through an interactive interface.
- regenerate Harmony Core components without manually editing scripts.
- validate your configuration.
- add or update Traditional Bridge projects.
- synchronize generated code with your Visual Studio solution.
For an overview of the tool and its capabilities, see Introduction to the Harmony Core CLI Tool.
Ensure your Harmony Core solution includes one of the following files in its solution directory: regen.bat (or regen_config.bat for older projects). Note that this file must reside in the solution directory, not in a subfolder.
From a terminal, navigate to the solution directory for your Harmony Core solution.
Run the following command:
harmonycore gui
The tool will display a “Loading Solution…” message while initializing.
Once the CLI Tool GUI opens:
-
Select File > Import from the menu.

-
The CLI Tool will import settings from your
regen.bat(orregen_config.bat) and related files--e.g., the Repository project,userDefinedTokens.tkn(if present), etc.
If the repository project is missing required NuGet packages, you may be prompted to allow the CLI Tool to resolve this.
The import converts the regen.bat file configuration into the new CLI Tool format, which is stored in Harmony.Core.CodeGen.json in the solution directory.
After the import completes, the solution directory should include a Harmony.Core.CodeGen.json file, the CLI Tool GUI screens should now display information for your solution, and the Structures tab should show any repository structures that were specified in regen.bat.
-
Select File > Save to save your configuration.
-
Choose Codegen > Regen to regenerate Harmony Core code, or select Codegen > Sync VS to regenerate code and update your Visual Studio solution with generated files.
Once confirmed, you can archive or delete the old regen.bat file. Your project will now rely entirely on the CLI Tool configuration.
-
Tutorial 2: Building a Service from Scratch
- Creating a Basic Solution
- Enabling OData Support
- Configuring Self Hosting
- Entity Collection Endpoints
- API Documentation
- Single Entity Endpoints
- OData Query Support
- Alternate Key Endpoints
- Expanding Relations
- Postman Tests
- Supporting CRUD Operations
- Adding a Primary Key Factory
- Adding Create Endpoints
- Adding Upsert Endpoints
- Adding Patch Endpoints
- Adding Delete Endpoints
-
Harmony Core CLI Tool
-
OData Aware Tools
-
Advanced Topics
- CLI Tool Customization
- Adapters
- API Versioning
- Authentication
- Authorization
- Collection Counts
- Customization File
- Custom Field Types
- Custom File Specs
- Custom Properties
- Customizing Generated Code
- Deploying to Linux
- Dynamic Call Protocol
- Environment Variables
- Field Security
- File I/O
- Improving AppSettings Processing
- Logging
- Optimistic Concurrency
- Multi-Tenancy
- Publishing in IIS
- Repeatable Unit Tests
- Stored Procedure Routing
- Suppressing OData Metadata
- Traditional Bridge
- Unit Testing
- EF Core Optimization
- Updating a Harmony Core Solution
- Updating to 3.1.90
- Creating a new Release
-
Background Information