Professional Edition Tool

.Net DLL/WSDL Importer for Delphi

A graphical wizard for importing .NET assemblies, NuGet packages and WSDL web services into Delphi — with a command-line tool for build scripts and CI. Turns third-party .NET libraries and web services into ready-to-compile Delphi units.

 Free Trial    Order    Documentation

The Import Utility is part of the .Net Runtime Library for Delphi Professional Edition.

The problem it solves

Consuming a third-party .NET library or a SOAP web service has historically meant hand-locating the assembly, hand-writing its fully-qualified name and version string, hand-building a proxy class for a web service, and chasing every dependency yourself — the most common source of support tickets: "it can't find the assembly", "missing dependency", "wrong version". The Importer's Add from NuGet flow hands that job to the tool that already knows how to do it — NuGet — and Import a web service builds the proxy and the units straight from a WSDL.

How NuGet import works

  • 1. Search. Find a package by id, or type one in, and pick the version you want.
  • 2. Resolve. The package and its full transitive dependency closure are restored into an isolated working folder, for .NET Framework 4.7.2.
  • 3. Target. Packages that support netstandard2.0 resolve too; the importer registers netstandard.dll for you.
  • 4. Generate. The same type-import pipeline runs over the resolved DLL set and emits ready-to-compile bridge units.
  • 5. Deploy. A generated *.deploy.txt manifest lists exactly which DLLs to ship.
The friction it removes
// Before - hand-written, hand-maintained:
ASSEMBLY_PATH =
  'C:\Program Files (x86)\MyLib\MyLib.dll';

ASSEMBLY_STRING =
  'MyLib, Version=1.4.0.0, Culture=neutral, ' +
  'PublicKeyToken=b03f5f7f11d50a3a';

// With Add from NuGet or Import a web service:
//   1. search a package, or point at a WSDL
//   2. dependencies resolved, or the proxy built, for you
//   3. bridge units + a deploy.txt manifest generated

Also runs without a window

CNAssemblyImport.exe does everything the window does — assemblies, NuGet packages and WSDL web services alike — from the command line. Use it in a build script, on a build server, or anywhere an import should be repeatable: it reads and writes the same import project file as the window, so a selection made once can be re-run unattended.

Requirements and notes

  • Requires a .Net Runtime Library for Delphi Professional Edition licence.
  • Needs the .NET Framework 4.7.2 or later on the machine (Windows 10 1803+ and Windows 11 already have it).
  • Add from NuGet also needs the .NET SDK on the development machine; importing files and web services does not.
  • A web service's password is never saved in an import project, but it is written into the generated unit as a constant — keep such units out of source control.
  • Transitive graphs can be large; the tool surfaces the whole graph so you can trim what you import.

Import Utility — A Closer Look

Four steps — Assemblies, Types, Loading, Output — take a local DLL/EXE or a NuGet package to ready-to-compile Delphi units; a fifth tab covers importing a WSDL web service. The screenshots are the importer's dark theme, the default.

Step 1

Assemblies

Start from a file you already have, or let NuGet do the work of finding one.

  • Drop one or more .dll or .exe files on the window, or press Browse for assemblies.
  • Or press Add from NuGet, type a package id (for example Newtonsoft.Json), leave Version empty for the latest or type one, and press Resolve.
  • The result lists the package and its full transitive dependency closure — the package itself marked imported, everything it needs marked dependency (ship). Press Add to import.
  • Each assembly then appears as its own card; its Delphi unit name is editable.
  • Resolved packages are cached under %LOCALAPPDATA%\CrystalNet Technologies\Importer\NuGet — point CNIMPORT_NUGET_WORKDIR elsewhere for a build server or shared cache.
A message explaining what is missing The wizard tells you exactly what is still missing before you can move on — no guessing.
The first page, with nothing added yet
The first page, with nothing added yet The Add from NuGet dialog A resolved NuGet package with its dependencies Two assemblies added

Click a screenshot to view it full size

Step 2

Types

Only what you check is written to the units — nothing is checked when you arrive.

  • Every type has a round badge: C class, I interface, S structure, E enumeration, D delegate.
  • Check a type to import it, which checks all of its members; open a type to check or clear single constructors, fields, properties, methods and events.
  • The search box matches any part of a type's full name; a filter narrows the list to one kind.
  • Show the selected types only is a quick way to review a selection; Select all and Clear act on what the search and filter are currently showing.
  • Types an obfuscator renamed to characters Delphi cannot compile are marked — leave them out on the Output page.
A type with its members
The Types page A type with its members Searching the type list

Click a screenshot to view it full size

Step 3

Loading

Tells the generated units where to find the assembly when your Delphi program runs. Every assembly has its own card; a web service has nothing to set.

  • From a file location — the default: loads from the folder the assembly was added from.
  • From the folder of the application — loads next to your Delphi executable, the usual way to deploy.
  • UnsafeLoadFrom — loads a file Windows marked untrusted (downloaded, or from a network share); unblocking the file is usually the better fix.
  • Dependency folders — add the folders an assembly's own dependencies live in. NuGet assemblies already have theirs alongside them.
The Loading page

Click the screenshot to view it full size

Step 4

Output

Choose the folder and the code-generation options, check the plan, import.

  • The generated .pas files are written to the unit folder — add it to your project's library path.
  • Seven switches decide how the units are written — splitting large units, optimizing generation, public fields, type references, Delphi generics and callbacks, and the Framework Class Library — all on by default.
  • Leave out obfuscated names skips types and members an obfuscator renamed, so the units still build.
  • Press Import: the progress window shows the assemblies being analysed, then the units written. Cancel stops at the next step; files already written stay.
  • When it is done, every file is listed with its folder and any error. Open folder shows the units in Explorer. For a NuGet package, the deployment manifest is among the files.
The Output page
The Output page The import running The finished import

Click a screenshot to view it full size

Web Service

Import a web service

Generate Delphi units from a WSDL — a URL or a file — like an assembly: the importer builds a proxy class for the service and lists its types.

  • Press Import a web service on the first page, or start the importer from the IDE's Import WSDL/XML Webservice menu entry.
  • Enter the WSDL location: a URL or a file, with Browse.
  • Choose the protocol (SOAP 1.2 is the default; SOAP 1.1, HTTP GET, HTTP POST and HTTP SOAP are available) and, if you like, a unit name.
  • If the service needs a user, open The service needs credentials and enter the domain (if any), user name and password.
  • Press Add to import. The service then appears as a card marked Web service, and its types as those of an assembly.
The password is not written to an import project, but it is written to the generated unit. A unit that connects with a user name holds the domain, user name and password as constants — keep such units out of source control and out of anything you publish.
The Import a web service window

Click the screenshot to view it full size

×