- .Net Core SDK
- .Net IDE of choice
- Access to the SkySync SDK packages
All of our tutorials will begin from the command-line. This is the most portable way to work with the dotnet
CLI and makes no assumptions about your operating system or IDE of choice. In order to make it super easy to create custom SkySync Platform extensions, we deliver a custom dotnet new
template package. Your IDE should have details available on how to leverage custom dotnet new
templates from within the IDE if you prefer to stay in there. If you are unfamiliar with custom templates within the dotnet
CLI, you can review here and here for more information. Our first step is to install the SkySync dotnet new
template package.
Code Block |
---|
|
dotnet new --install PortalArchitects.CustomExtension.Templates |
If you are installing a beta version of the template, then you need to specifically include the version that you would like to install.
Code Block |
---|
|
dotnet new --install PortalArchitects.CustomExtension.Templates::4.X.0-beta-100 |
If you have a previous version of the template, you will need to uninstall that version first. There are circumstances when the dotnet new
command will not uninstall and in those, it will need to be reinitialized.
Code Block |
---|
|
# uninstall the template
dotnet new --uninstall PortalArchitects.CustomExtension.Templates
# or reinitialize
dotnet new --debug:reinit |
Creating Your First Extension
While there are a number of parameters that you can use to customize the project generated by the dotnet new
template, the most basic extension can be created using:
Code Block |
---|
|
dotnet new skysynclib --name MyCustomExtension |
This will create two new projects within a "MyCustomExtension" directory. The first is the actual extension within src\MyCustomExtension\MyCustomExtension.csproj
and the second is a pre-configured test project within test\MyCustomExtension.Tests\MyCustomExtension.Tests.csproj
. Due to a limitation in the tooling, it does not currently create a new solution to go with these new projects. In order to work around that, it is recommended that you run the following:
Code Block |
---|
|
cd MyCustomExtension
dotnet new solution
dotnet sln add src\MyCustomExtension\MyCustomExtension.csproj
dotnet sln add test\MyCustomExtension.Tests\MyCustomExtension.Tests.csproj |
This will create a solution that contains the two new projects that we created in the previous step.