Before starting this walkthrough, it is recommended that you have fully prepared your machine environment for mobile development. If you haven't done so, it is recommended that you have gone through the following documentation:
It is recommended that you have read through these conceptual topics in order to get a better understanding:
To use this walkthrough, you will need to be able to use Xamarin Studio on Mac and Visual Studio on Windows.
Let's get started.
Preparing the Project
Let's begin by preparing the project.
If you're on Mac, follow these steps.
- Start by creating a New Solution in Xamarin Studio.
- In the dialog that appears, choose Cross-platform App, Single View App.
- Enter the project details as follows.
- Hit Create.
Your project is now ready.
If you're on Windows, follow these steps.
- In Visual Studio, start by hitting New, Project.
- On the dialog that appears, choose Visual C#, Cross-Platform, Blank App (Native Portable). Enter FirstCrosslightApp as the project name. Hit OK.
- Enter the FirstCrosslightApp as the project name. Hit OK.
- Your project is now ready.
Configuring Crosslight Packages on Mac
This section describes how you can start using Crosslight NuGet packages on Mac with Xamarin Studio.
- Copy and extract the Intersoft.PackageManagement.Extensions.0.1.zip to /Users/(username)/Library/Application Support/XamarinStudio-5.0/LocalInstaller/AddIns/. You can skip this step if you have installed Crosslight using the Mobile Studio 2016 (or newer) installer. You can also verify that this is installed through Xamarin Studio, Add-in Manager.
- Open Xamarin Studio. You should see that a new Intersoft Package Console Extension is installed. Click on the menu.
In the window that appears, type in the following command
- This will install the Intersoft.Crosslight package into entire projects in your solution.
- At the end of the process, you should see the following message.
- Now, your Crosslight references will be ready. To check, expand each project and check the References/From Packages node.
- You're now ready to use Crosslight.
The -allProjects switch you've executed earlier is part of the additional command provided by Intersoft Package Console Extension. To see all additional commands available, check out this document: Introduction to Crosslight NuGet Packages.
Configuring Crosslight Packages on Windows
This section describes how you can start using Crosslight NuGet packages on Windows with Visual Studio.
- In Visual Studio, open Package Manager Console via View, Other Windows, Package Manager Console.
In the dialog that appears at the bottom of Visual Studio, enter the following command.
As shown in the following screenshot.
- If all goes well, you should see output message similar to the following shot.
- In your Solution Explorer, you should see Crosslight packages appear in your projects' references.
- You are now ready to use Crosslight.
Alternatively, you can also use the Manage NuGet UI to browse, install, or update Crosslight packages when using Visual Studio on Windows. See the following steps to learn more:
- Right-click on the Solution in the Solution Explorer window and choose Manage NuGet Package for Solution.
- In the window that appears, choose Browse, then type in "intersoft.crosslight" (without the quotes). Tick all the projects that you would like to apply the package to and hit Install.
- And once it's done installing, you'll see the following in the Output window of Visual Studio.
- You'll see that your Crosslight references are now installed and now you're ready to begin development.
You've just learned how to use NuGet to resolve Crosslight assemblies and use them in your projects. While this walkthrough shows how to apply Crosslight packages in a new project, you can also perform the same steps for existing projects. Keep in mind that Crosslight packages that support multiple targetable frameworks need to be installed only once to the selected projects. For more information about Crosslight packages, see Introduction to Crosslight NuGet Packages.
In this walkthrough, although you are guided to create projects from Xamarin's cross-platform projects, it is recommended to use Crosslight Project Wizard for the best way to get started with Crosslight. By default, all projects created using Crosslight Project Wizard (version 5.0 and above) will automatically use NuGet Package Manager as the main dependency manager, so you can skip this walkthrough altogether. For step-by-step instruction to create a new Crosslight project using wizard, see Walkthrough: Creating New Project with Crosslight Project Wizard.