Table of Contents

Visual Studio designer

ExControls works in the Windows Forms designer of Visual Studio in .NET Framework and .NET projects. The controls are in the toolbox with their own icons and the designer offers their properties, smart tags and editors.

.NET projects

The designer of .NET projects runs out of process and loads custom type editors only from NuGet packages, from the Design/WinForms folder next to the referenced assembly. The ExControls package contains this extension in lib/<tfm>/Design/WinForms, so nothing has to be installed: editors such as the collection editor of ExOptionsView.Panels work after the package is added.

The toolbox of a .NET project looks up the icon of a control only in the assembly of the control. ExControls therefore embeds its own 16×16 icons for all controls.

.NET Framework projects

The designer runs in the Visual Studio process and uses the designers and editors in ExControls.dll directly. See .NET Framework and .NET for the other differences.

Project reference instead of the package

A project that references the ExControls source code (ProjectReference) instead of the package doesn't get the extension from NuGet. Import ExControls.Designer.targets from the repository next to the project reference:

<ItemGroup>
  <ProjectReference Include="..\ExControls\ExControls\ExControls.csproj" />
</ItemGroup>
<Import Project="..\ExControls\ExControls.Designer.targets" />

The project ExControls.Designer.Package in the ExControls solution builds the extension as artifacts/packages/ExControls.Designer.<version>.nupkg and the targets file references it. Until the package is built, the reference is skipped: the project builds, only the editors are missing in the designer. The extension isn't copied to the output of the project and doesn't flow to dependent projects.

Troubleshooting

  • "Failed to launch the design tools server process" on every form. The designer uses an outdated extension. NuGet and Visual Studio cache the package by its version, so a package rebuilt with the same version is ignored. Update the ExControls package, or with a project reference increase ExControlsDesignerVersion in ExControls.Designer.targets, build the solution and restart Visual Studio.
  • The designer shows old controls after a change of ExControls. The designer loads ExControls.dll from the build output. Build the solution and open the form again; if that doesn't help, restart Visual Studio.