Guides (SDK /API)Technical ReferenceBBDNHow-to Documentation

You are here: Custom Parts Setup > Custom Parts Creation > Copy the Files for a Custom Part

Copy the Files for a Custom Part

Typically, a custom part consists of two user controls (.ascx files) and one or more DLL assemblies for your project. You copy the .ascx files to the \NetCommunity\Custom folder of your installation (or a subfolder within \NetCommunity\Custom), and you copy the .dll files to the \NetCommunity\bin folder.

You must deploy custom parts every time you build a Parts project, so to save time and reduce errors, you can configure the project’s post-build event to automatically deploy the project after you build.

  1. In Visual Studio, open the properties sheet for the Parts project.

  2. On the Compile tab, click Build Events. The Build Events screen appears.

  3. Click Edit Post-build. The Post-build Event Command Line appears.

  4. In the command line edit window, replace the default post-build event commands with the following commands and then replace the destination paths with the locations in your installation directory:

    copy "$(ProjectDir)*.ascx" "C:\Infinity\DEV\Firebird\ClassicCMS\Web\Content\Portal\Custom\$(ProjectName)" /s /I /y
    xcopy "$(TargetDir)$(ProjectName).*" "C:\Infinity\DEV\Firebird\ClassicCMS\Web\Content\Portal\bin" /y
    xcopy "$(TargetDir)*.WebApiClient.*" "C:\Infinity\DEV\Firebird\ClassicCMS\Web\Content\Portal\bin" /y
  5. Replace the destination paths in the commands with the appropriate locations in your installation directory. Remember to place your .ascx files in the \custom folder or a subfolder and your code-behind DLL and any *.webApiClient.dlls in the \bin folder.

  6. When you successfully recompile, these commands copy files to your installation folder.

Note: For more complex custom parts, you can add commands to copy related files such as images, scripts, and style sheets.