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:
- MSBuild - runner with MSBuild and Mono XBuild support
- Visual Studio (sln) - runner simulating Visual Studio IDE (devenv) using MSBuild
- Visual Studio 2003 - the same as the previous runner, but taking into account the specifics of Visual Studio 2003
- Visual Studio Tests - runner that runs Visual Studio and MS tests
- .NET Process Runner - runner that launches .NET applications
- .NET CLI Runner – , TeamCity .NET Core CLI
- NUnit – , NUnit-
- NuGet – nuget.exe CLI Windows
- TeamCity NuGet
- TeamCity symbol server –
- Azure DevOps ( Team Foundation Server)
- Duplicates Finder (ReSharper) –
- Inspections (ReSharper) – JetBrains Resharper
- FxCop – FxCop
- JetBrains dotTrace – dotTrace Command-Line Profiler
- JetBrains dotMemory Unit – JetBrains dotMemory Unit
- 3D- Unity
TeamCity .NET, . , , , :
- .NET-
..
, .NET Core , Microsoft , .NET SDK. .NET 5 – .NET Core, .NET Framework, Xamarin Mono. 2020.1 TeamCity , , , .NET. . , .NET . :
, .NET, . .NET 5 Visual Studio Rider.
-
, .NET – .NET CLI. , .NET-. TeamCity . TeamCity -.
- .NET .NET :
|
|
|
TeamCity |
|
|
.NET Standard 1.2 |
|
|
NuGet |
|
.NET Standard 1.2 |
IoC |
|
NuGet |
|
.NET 5.0 |
|
|
|
|
.NET 5.0 |
|
|
Docker |
|
.NET 5.0 |
Web |
|
Docker |
|
.NET 4.8 WPF |
|
|
Windows |
|
UAP |
UWP- |
|
UWP |
|
.NET Standard 1.2 |
Xamarin |
|
Android |
|
Xamarin Android |
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 |
«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»
- Push image … Linux Windows
- Push multi-arch image … - Docker.
- Publish to NuGet NuGet TeamCity NuGet.
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
Microsoft .NET 5, . TeamCity , .NET .NET 5 .
, . .