Repository navigation
LHQ Model v3 Changes
When model version v2 was released, it introduced the Handlebars template engine for templating and the ChakraCore engine for executing JavaScript code in C#/.NET applications. It also included built-in JavaScript code to prepare and execute Handlebars templates and return results to the C# application.
Note
Read more about v2 changes in LHQ-Model-v2-Changes.
The motivation for upgrading to model version v3 was twofold:
- To create a unified
npm packagethat can process*.lhqfiles usinghbstemplates across any host/platform (browser, Node.js, CI builds, Windows applications) - To replace the
ChakraCore enginewith the more modernV8 engineafter discovering that modern JavaScript constructs used in the package were not compatible with ChakraCore
Important
Generated strings in *.resx files are encoded differently than in previous versions.
Previous versions of the LHQ model (v1 and v2) used the legacy C# web encoding for strings.
Since the new model (v3) aims to be universal across all OS platforms (Windows / Linux / macOS), a unified encoding for XML values was chosen. This encoding differs from C# but remains consistent across all OS platforms.
Example:
Previously -> "abc" was encoded as 'abc'
Now -> "abc" is encoded as 'abc'
In previous model versions (v1 and v2), the generator attempted to detect the namespace value from csproj files associated with *.lhq files for C#-related templates at the template execution stage.
Starting with model version v3, this namespace detection has been removed from the template execution stage.
This change affects the following C# code generation templates:
- NetCoreResxCsharp01
- NetFwResxCsharp01
- WinFormsResxCsharp01
- WpfResxCsharp01
UI editors support detection of the Namespace value at design time.
UI editors:
- LHQ Editor extension for
Visual Studio 2022 / 2026 - LHQ Editor app (Windows desktop application)
- LHQ Editor for
VS Code
If the generator fails with a "missing namespace value" error, the UI editor will attempt to detect the Namespace value and save it to the template settings upon user confirmation. This check is performed only for C#-related templates.
Note
If you are using command-line tools or CI/CD builds without UI editors, no namespace detection is performed. Please ensure that the Namespace value is set in template settings for C#-related templates.