.NET Integration Approach to TeamCity

At TeamCity, we have always paid special attention to .NET, its many tools and testing frameworks. In this post, we want to talk about recent updates to our .NET support and share a sample demo project that illustrates them.



Now .NET support in TeamCity is implemented with a huge set of specialized " runners " and " build features ". Runers provide integration of the build with third-party software, and features act as functional add-ons to the build.



Prior to version 2020.1, TeamCity provided the following .NET components:





TeamCity .NET, . , , , :



  • .NET-


..



, .NET Core , Microsoft , .NET SDK. .NET 5 – .NET Core, .NET Framework, Xamarin Mono. 2020.1 TeamCity , , , .NET. . , .NET . :



  • .NET CLI
  • Windows MSBuild
  • «» Visual Studio IDE (devenv)
  • Windows , NUnit XUnit
  • Windows, .NET
  • Docker


, .NET, . .NET 5 Visual Studio Rider.



-



, .NET – .NET CLI. , .NET-. TeamCity . TeamCity -.



- .NET .NET :









TeamCity





Clock



.NET Standard 1.2







NuGet



NuGet



Clock.IoC



.NET Standard 1.2



IoC





NuGet



NuGet



Clock.Tests



.NET 5.0





Windows



Linux



 



Clock.Console



.NET 5.0





Windows x64



Linux x64



Docker Nanoserver



Docker Ubuntu



Docker multi-arch



Docker



Clock.Web



.NET 5.0



Web



Windows x64



Linux x64



Docker Nanoserver



Docker Ubuntu



Docker multi-arch



Docker



Clock.Desktop



.NET 4.8 WPF







Windows



Clock.Desktop.Uwp



UAP



UWP-



UWP



UWP



Clock.Xamarin



.NET Standard 1.2



Xamarin



C Android-



Android



Clock.Xamarin.Android



Xamarin Android



Android



C Android-



Android





CI/CD-, -. TeamCity , TeamCity Kotlin DSL. , . , . , , DSL, ( ).



2 :



  • Windows 10 x64 Pro 10.0.19041

    • Visual Studio 2019 Pro 16.8.1
    • Docker (Windows container) 19.03.13
    • .NET SDK 5.0
  • Ubuntu 16.04

    • Docker 18.06.3


GitHub Maven, IntelliJ IDEA 2020.2.2 : , .. , DSL- Kotlin.





DSL- .NET TeamCity. , TeamCity VCS root’, DSL-. , Versioned Settings, “Kotlin”:





, TeamCity DSL- .



.NET : «Building» «Deployment». -.





, .NET - – Build Deploy. :





– , Docker NuGet:





, , .NET- - /p:key=value. , - system.configuration=Release, /p:configuration=Release. system. , TeamCity , . , , TeamCity .NET:



TeamCity
configuration Release MSBuild-.
VersionPrefix 1.0.0 .
VersionSuffix beta%build.number% .
Build console and web InvariantGlobalization true , .
Build Windows desktop PublishDir ../bin/Clock.Desktop/win/ .
AppxPackageDir ../bin/Clock.Desktop.Uwp/win/ UWP .
Pack Copyright Copyright 2020 JetBrains NuGet-.
Title TeamCity .NET sample
RepositoryType git
RepositoryUrl https://github.com/JetBrains/teamcity-dotnet-samples.git
RepositoryBranch refs/heads/master


. TeamCity, – TeamCity . .



«Test on Windows Test on Linux»



Windows #1 Linux Docker- mcr.microsoft.com/dotnet/core/sdk:5.0, .NET. Linux Docker, UI :





Linux Docker- .NET SDK 5.0. Windows , Docker.



Clock.Tests .NET 5.0, .NET Core CLI test. JetBrains dotCover JetBrains.dotCover.DotNetCliTool, TeamCity. DSL, TestBase Linux Windows.



«Build console and web for win-x64» «Build console and web for linux-x64»



TeamCity Linux Windows Clock.Console Clock.Web , . BuildConsoleAndWebBase, – BuildBase. , Projects , , outputDir. .NET 5.0, , .NET Core CLI publish.



UI Linux, Clock.Console , Output directory:





Windows, Runtime, win-x64, Output directory bin/Clock.Console/win-x64.



Clock.Web Linux , , Output directory bin/Clock.Web/linux-x64. , TeamCity .



win-x64:



  • bin/Clock.Console/win-x64/Clock.Console
  • bin/Clock.Console/win-x64/Clock.Web


linux-x64:



  • bin/Clock.Console/linux-x64/Clock.Console
  • bin/Clock.Console/linux-x64/Clock.Web


«Build Windows desktop»



:





Windows MSBuild Visual Studio 2019 #1 «» Restore, Rebuild Publish :



  • Clock.Desktop/Clock.Desktop.csproj
  • Clock.Desktop.Uwp/Clock.Desktop.csproj


, PublishDir ( Clock.Desktop) AppxPackageDir ( Clock.Desktop.Uwp). .



«Build Android app»



Android, Windows MSBuild Visual Studio 2019, #1:





, MSBuild «» Publish «» SignAndroidPackage, Android-.



«Pack»



NuGet- .NET CLI pack, – Clock Clock.IoC:





NuGet- , .., TeamCity – . , NuGet-, .



«Build»



TeamCity . , TeamCity- - :





«Deploy»



, , :





NuGet- , NuGet-. Clock.Console Docker :



docker pull nikolayp/clock-console
docker run -it --rm nikolayp/clock-console


Clock.Web:



docker pull nikolayp/clock-web
docker run -it --rm -p 5000:5000 nikolayp/clock-web


- , http://localhost:5000/.



.





Microsoft .NET 5, . TeamCity , .NET .NET 5 .



, . .




All Articles