VCL for .NET deployment
Before we move on to sample applications with database support, let's look at deployment of a Delphi for .NET application—specifically, a VCL for .NET application. If we take the last sample application, and look inside the Project Manager, the reference node of the project lists only the System.Drawing.dll assembly. This is the only assembly the AppEvents sample application for .NET requires. All VCL for .NET units are compiled into the executable, which as a consequence is about 1.5 MB.
On the bright side, you need to deploy only the AppEvents executable (the System.Drawing.dll assembly exists on any Microsoft .NET Framework installation), and no additional VCL for .NET assemblies. In some situations, however, it might be more desirable to deploy a smaller AppEvents executable and rely on VCL for .NET functionality in VCL for .NET assemblies that are already (or at the same time) deployed on the target machine. In that respect, .NET assemblies can be seen as runtime packages. Use this functionality when the project is modified frequently and the distribution of a small updated executable is more efficient than the distribution of a larger monolithic execution.
The developer must choose, but the default "setting" for new VCL for .NET applications is to compile executables without linking in the VCL for .NET assemblies (in other words: small executables that need the VCL for .NET assemblies to be deployed as well). When migrating VCL projects to Delphi for .NET, however, the IDE will not add the VCL for .NET assemblies to the list of references, and as a result the VCL for .NET units will be compiled into a monolithic executable.
In order to change a migrated VCL for .NET project, manually add the VCL for .NET assemblies as references to the project (specifically the Borland.Delphi.dll and Borland.Vcl.dll), and recompile the project. This results in an AppEvents sample application for .NET of only 12 KB, albeit one that requires the Borland.Delphi.dll and Borland.Vcl.dll assemblies to be deployed alongside.
Next, we focus on more-difficult applications with database support.
Was this article helpful?