Learn the basic steps to set up the Square SDK for a .NET 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:
- Create a project.
- Right-click the project, and then choose Add NuGet package. Search for Square and add the package.
- Add your code.
Not using Visual Studio:
You can use the .NET CLI to start a project.
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:
For a list of available project templates, you can use this command:
dotnet new --list.
Add NuGet packages.
Add your application code.
Run the code.
For more information, see .NET CLI overview.
There are various NuGet tools you can use to install packages in your project. For example:
Install using the dotnet CLI.
Install with NuGet.exe.
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.