---
title: "Compile the sample Commerce Engine"
slug: "compile-the-sample-commerce-engine"
abstract: "How to compile and package the Sitecore XC Engine."
---
# Compile the sample Commerce Engine

You can customize the Sitecore XC Engine, using the SDK package provided in the release package.

When you make changes to the Sitecore XC Engine (using the SDK), you must re-compile the Commerce Engine.

To compile and package the Sitecore XC Engine using the command line method (recommended):

1. Start a command prompt as administrator and go to the [Sitecore Commerce Engine SDK](https://doc.sitecore.com/xp/en/developers/102/sitecore-experience-commerce/sitecore-commerce-engine-sdk.html "Sitecore Commerce Engine SDK") root directory (that is, where you extracted the SDK zip file).
2. Run the following command:

    `dotnet.exe restore Customer.Sample.Solution.sln`

    > [!note]
    > The default `dotnet` path is `"C:\Program Files\dotnet\dotnet.exe"`. You must specify the solution name because there are two `.sln` files under the Engine SDK root directory.

3. Run the following command:

    `dotnet.exe publish Customer.Sample.Solution.sln -o <output-dir>`

    > [!note]
    > Make sure that the installed version of the .NET Framework is the DevPack/SDK edition, not the Runtime edition. The `dotnet publish` command fails if only the Runtime edition is installed.

4. Zip the contents of the output folder (where you published the `Customer.Sample.Solution`). Make sure that the root of the .ZIP file contains the compiled DLLs and folders, for example:

    ![Folder structure and compiled DLLs.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/sitecore-experience-commerce/images/Compiled_DLLs_and_folders_image4.png)

5. Copy the zipped `Sitecore.Experience.Commerce.Engine.*.zip` file to your deployment root.

To compile and package the Sitecore XC Engine using Visual Studio:

1. Launch Visual Studio.
2. From the `Sitecore Commerce Engine SDK` folder, open the `Customer.Sample.Solution.sln` file
3. To build the solution, on the menu bar, click **Build**.
4. To publish the `Sitecore.Commerce.Engine` project to your file system, click **Publish**.
5. Zip the contents of the output folder (where you published the` Customer.Sample.Solution`. Make sure that the root of the .zip file contains the compiled DLLs and folders, for example:

    ![Folder structure and compiled DLLs.](https://doc.sitecore.com/api/markdown-image/xp/en/developers/102/sitecore-experience-commerce/images/Compiled_DLLs_and_folders_image4.png)

6. Copy the zipped `Sitecore.Experience.Commerce.Engine.*.zip` file to your deployment root.