Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Now that we have our csproj set up, we need to download the SDK, so we can start making our plugin. The first thing we do, is add the file nuget.config next to our sln file. Remember to fill in the password for dscbuildserver. This file ensures that NuGet will be able to find the download page for the NuGet packages. It is also required on TeamCity later on in this tutorial.

NuGet.config

Code Block
languagexml
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <config>
    <add key="repositoryPath" value="packages"/>
  </config>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <packageSources>
    <add key="nuget.org" value="https://www.nuget.org/api/v2/" />
    <add key="TeamcityAuth" value="https://build.deltares.nl/httpAuth/app/nuget/v1/FeedService.svc/" />
    <add key="Teamcity" value="https://build.deltares.nl/guestAuth/app/nuget/v1/FeedService.svc/" />
  </packageSources>
  <activePackageSource>
    <add key="TeamcityAuth" value="https://build.deltares.nl/httpAuth/app/nuget/v1/FeedService.svc/" />
  </activePackageSource>
  <packageSourceCredentials>
    <TeamcityAuth>
      <add key="Username" value="dscbuildserver" />
      <add key="ClearTextPassword" value="[DSCBUILDSERVERPASSWORD]" />
    </TeamcityAuth>
  </packageSourceCredentials>
</configuration>

Now open the Package Manager Console in Visual Studio. You can download the Delta Shell SDK by calling the command Install-Package DeltaShell.Framework -Version x.x.x.xxxx. This will install DeltaShell.Framework into the packages folder next to your sln file. And it will also add a reference to DeltaShell.Framework in your csproj.

Because we want to make an ApplicationPlugin, we are going to need another package. Install it in the same way via the Package Manager ConsoleInstall-Package DeltaShell.ApplicationPlugin -Version x.x.x.xxxx. To stay consistent, use the same version number.

Info

Make sure that you always use the latest pinned version from TeamCity. Omitting the -Version option will give you the latest successful build, but this is not desired.

DeltaShell.ApplicationPlugin

What's in the DeltaShell.ApplicationPlugin package? Well, it saves you a lot of time setting up your project. First of all, it ensures that your project will build to the correct output location. Which is $(SolutionDir)bin\$(Configuration)\plugins\$(AssemblyName). Doing so speeds up the building process. I will tell more about this concept later on in this tutorial.

It also adds some extra Assembly Info, so that the Mono.Addins library knows that this assembly is a plugin assembly.

DeltaShell.Framework

The DeltaShell.Framework package ensures that all files in the framework are on your computer. It also adds a .targets fie to your project so that it will copy the framework files into $(SolutionDir}bin\DeltaShell.

DeltaShell.TestProject

You can also make a unit test project that works in Delta Shell. To do so, install the DeltaShell.TestProject package into your test project. Take notice of the Default Project in the Package Manager Console, because you want the DeltaShell.TestProject to be in your test project and not in your application plugin project.

Adding dll references

While you are