Set up your Square SDK for a .NET Project

Learn the basic steps to set up the Square SDK for a .NET project.

Link to section

Start a new project

If you're new to developing Square integrations using the Square .NET SDK, try the Quickstart. It provides step-by-step instructions to explore your first project.

The following are general guidelines for creating a new .NET project:

  • Using Visual Studio:

    1. Create a project.
    2. Right-click the project, and then choose Add NuGet package. Search for Square and add the package.
    3. Add your code.
  • Not using Visual Studio:

    You can use the .NET CLI to start a project.

    1. For example, to create a console application, open a command prompt, create a folder, and navigate to it. Then enter the following to create an empty project:

      dotnet new console --name <project-name>

      For a list of available project templates, you can use this command: dotnet new --list.

    2. Add NuGet packages.

      dotnet add package Square
    3. Add your application code.

    4. Run the code.

      dotnet run

For more information, see .NET CLI overview.

Link to section

Install Square packages

There are various NuGet tools you can use to install packages in your project. For example:

  • Install using the dotnet CLI.

    dotnet add package Square
  • Install with NuGet.exe.

    nuget install Square
  • Use the Package Manager console for Visual Studio on Windows - In Visual Studio, right-click the project and choose Add NuGet Package. Search for the Square package and install it.

  • Use the Manage NuGet UI in Visual Studio on a Mac - In Visual Studio, right-click the project Dependencies and choose Manage NuGet Packages. Search for the Square package and install it.

In Visual Studio, right-click the project and choose Add NuGet Package. Search for the Square package and install it.

For an introduction to the NuGet and NuGet tools, see NuGet Tools.

Link to section

See also