JetBrains Space Help

.NET Framework


  • You have a solution targeting .NET Framework.

  • You have an self-hosted worker with Windows OS that meets the requirements listed below.

Requirements to the host machine

Build and run tests in a .NET Framework solution

Currently, Space Automation does not provide any special API for working with .NET Framework projects. This means, that you should run .NET Framework builds by using the build tools directly inside shell scripts.

The content of .space.kts might look like follows:

// paths to tools val nuget = "C:\\nuget\\nuget.exe" val msbuild = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\MSBuild\\Current\\Bin\\MsBuild.exe" val nunit = "C:\\Program Files (x86)\\\\nunit-console\\nunit3-console.exe" job("Build and test") { host("Run nuget, msbuild, nunit") { shellScript { // 1. Restore dependencies // 2. Build the solution (MySolution.sln) // 3. Run tests in the MainTests.csproj project // To escape spaces in command line, we use quotes e.g. "$msbuild" content = """ "$nuget" restore "$msbuild" netframework-sample.sln "$nunit" MainTests\MainTests.csproj """ } // run this job only on // a Windows worker requirements { os { type = OSType.Windows } } } }
Last modified: 15 December 2023