This page will lead you through the process of creating and setting up a project when using the .NET Realtime SDK. It will show examples for regular .NET and for UWP.
- Creating and setting up the Visual Studio project
- Creating and setting up the Visual Studio project for UWP
The first step you have to do is to download the .NET Realtime SDK. You can do this on the SDKs download page or by following this direct link. Note: downloading any SDK requires you to be signed in. If you haven't created an account yet, please do this before, you will need it anyway.
After downloading the SDK, you can extract the archive's content. This SDK already includes a Visual Studio solution and some example projects, which you can take a look at, too. Furthermore the SDK contains the necessary libraries and the LoadbalancingAPI. We will need both folders and their included files later.
Creating and setting up the Visual Studio project
Next we want to set up our own Visual Studio project and start working with Photon. To do so, we start Visual Studio (in our example we are using Visual Studio 2017) and create a new project under File/New/Project.... This opens up the New Project dialog where we select Console App (.NET Framework) under Visual C#. This will create a new solution with an almost empty project.
Afterwards we navigate to our previously extracted .NET Realtime SDK archive and go into /libs/Debug/, select all Photon3DotNet files and copy them into a Libs directory (you have to create this one) in our .NET project. Back in Visual Studio we right-click on References in our project and select Add Reference.... A new dialog opens up where we click on the Browse button, navigate first to our solution and project folder and then into the newly created Libs folder. In this folder we select the Photon3DotNet.dll and click on the Add button. We can close the Reference Manager window by clicking OK. You will notice that this step has added Photon3DotNet to the project's references.
Next we want to add a new folder to the project. We therefore right-click on our project in the Solution Explorer and select Add/New Folder. This will create a new folder in our project, which we name LoadbalancingAPI. Now we right-click on that new folder and select Add/Existing Item.... In the new dialog we navigate to our extracted archive again and select all .cs files in the PhotonLoadbalancingApi folder and click on the Add button. This will copy the selected files to the new LoadbalancingAPI folder in our project.
We are now ready to start developing our application. To see how this works, you can continue reading here.
Creating and setting up the Visual Studio project for UWP
Creating and setting up the project for UWP is similar to regular .NET. Here we will start with creating a new project again. We open up the New Project dialog again, but this time we select Blank App (Universal Windows). This will create a new solution with an almost empty UWP project.
Afterwards we have to copy the libraries again. Therefore we navigate to the extracted archive and go into /libs/Debug/ again. This time we select all Photon3WindowsUniversal files and copy them into a Libs directory in our project. Back in Visual Studio we right-click on References in our project and select AddReferences.... The Reference Manager opens up and we add the Photon3WindowsUniversal.dll this time. After closing the Reference Manager by clicking on OK, you will notice that Photon3WindowsUniversal is added to the project's references.
Next we want to add the PhotonLoadbalancingApi again. Therefore we create a new folder in our project and call it LoadbalancingAPI. After right-clicking on this new folder, we select Add/Existing Item... to open up the dialog. In this new dialog we navigate to our extracted archive again, select all .cs file in the PhotonLoadbalancingApi folder and click on the Add button. This will copy the selected files to the new LoadbalancingAPI folder in our UWP project.
After this step we are ready to start developing our application.