Generate strongly typed C# wrappers and option set enums from a Dataverse solution zip (customizations.xml).
Want to run it now?
- Download:
DataversePluginWrapper-win-x64.zip - Unzip the file
- Run:
DataversePluginWrapper.exe
Release page: https://github.com/EricLott/DataversePluginWrapper/releases/latest
This tool reads Dataverse metadata and writes:
OptionSets/OptionValueSets.cswith global option set enums and state enumsEntities/*.cswrapper classes with CRUD helpers (Create,Retrieve,Update,Delete)
- A .NET console app (
DataversePluginWrapper) that parses Dataverse solution metadata. - A code generator only. It does not deploy to Dataverse.
- Supports both:
- CLI mode (arguments)
- Interactive mode (no arguments)
- .NET 6 SDK or later installed
- A Dataverse solution zip containing
customizations.xml
Check SDK:
dotnet --versiondotnet restore
dotnet buildRun with no arguments:
dotnet run --You will be prompted for:
- solution zip path
- output directory
- optional entity-name filter
- verbose logging toggle
- overwrite behavior
- final confirmation
dotnet run -- -z <path_to_solution_zip> [options]Options:
-z, --zip <path>: path to Dataverse solution zip (required)-o, --out <dir>: output directory (default:./GeneratedClasses_{timestamp})-f, --filter <text>: generate only entities whose display name contains text-v, --verbose: verbose logging-y, --yes: overwrite existing files without prompt-h, --help: show help
Generate everything:
dotnet run -- -z ./MySolution.zipGenerate only entities containing Contact:
dotnet run -- -z ./MySolution.zip -f ContactWrite to a fixed folder and overwrite existing files:
dotnet run -- -z ./MySolution.zip -o ./Generated -yWindows x64 example:
dotnet publish -c Release -r win-x64 --self-contained falseOutput executable will be under:
bin/Release/net6.0/win-x64/publish/
Run the EXE directly:
- no args -> interactive mode
- with args -> CLI mode
GeneratedClasses_20260221_153000/
|-- OptionSets/
| `-- OptionValueSets.cs
`-- Entities/
|-- Account.cs
|-- Contact.cs
`-- ...
- Generated entity wrappers use Dataverse SDK types (
IOrganizationService,Entity,EntityReference,OptionSetValue, etc.). - Option set/state values are mapped to enums where possible.
- Status reason is generated as numeric backing (
int?) with enum helper behavior. - Lookups/owners/customers are generated as
EntityReference.
In the project where you use generated files, ensure Dataverse SDK references are available (for example, Microsoft.Xrm.Sdk).
If your consuming project does not reference SDK assemblies, generated files will not compile.
0: success1: unexpected error2: argument/path error3: XML parsing error4: invalid data shape130: user canceled (Ctrl+C or interactive cancel)
- Ensure the zip is a Dataverse solution export.
- Verify the archive includes
customizations.xml.
- Check whether
--filterexcluded all entities. - Run without filter to validate metadata extraction.
- Use
-y/--yes, or answeryat overwrite prompts.
- Add Dataverse SDK references to the consuming project.
- Validate that generated namespace/import placement matches your project conventions.
Local project files:
Program.cs: generator implementationDataversePluginWrapper.csproj: project configuration
Build locally before committing:
dotnet build