Dotnet logo

.NET Tools

Essential productivity kit for .NET and game developers

How-To's

Rider 2017.2 EAP brings .NET Core 2.0, MSTest, and more

Rider 2017.2 Early Access Program

We’ve just opened the Rider 2017.2 Early Access Program (EAP) for you to download.

It comes with full support for .NET Core 2.0, adds MSTest, various NuGet improvements, a new debugger tool window for visualizing Parallel Stacks and marking of instances, new refactorings and more. And with ReSharper 2017.2 now released, we’ve updated the ReSharper version powering Rider, too. Which brings improved support for C# 7.0, initial support for C# 7.1, new code inspections, navigation improvements, and so on. Let’s look at a few highlights!

.NET Core 2.0 support

This first Rider 2017.2 EAP build adds support for .NET Core 2.0. All of the code inspections, navigation actions, quick-fixes and refactorings are now available for developing .NET Core 2.0 projects. The new ASP.NET Core Razor Pages projects are supported as well.
.NET Core 2.0 support in Rider

Rider can manage NuGet packages for .NET Core 2.0 projects, supports unit testing with xUnit, NUnit or MSTest, and supports running and debugging your .NET Core 2.0 projects.

Have a .NET Core 1.x project that no longer works after installing .NET Core 2.0 on your machine? No worries: Rider respects the .NET Core SDK version specified in a solution’s global.json file and uses the correct .NET Core version for your application. There’s even a .NET Core SDK selector plugin available.

Unit testing and MSTest

Rider’s unit test runner already supported xUnit and NUnit. With Rider 2017.2, we are bringing MSTest to the table! Running and debugging MSTest now works for the full .NET Framework (Windows-only for now) as well as .NET Core (on Windows, macOS and Linux).
Run xUnit, NUnit and MSTest unit tests in Rider

MSTest V2 will work out of the box, for MSTest V1 some additional setup is needed: Visual Studio will have to be installed (it’s a dependency of the framework…) and the path to the IDE will have to configured in the settings (Ctrl+Alt+S) under Build, Execution, Deployment | Unit Testing | MSTest.
Configure path to Visual Studio to enable MSTest V1 support

(if you want to copy the path for Visual Studio 2017 Community: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE)

NUnit tests are now supported for full .NET Framework, .NET Core 2.0, and .NET Core 1.1. We don’t have a project template for .NET Core NUnit projects at the moment (we use dotnet new under the hood as the source for templates), so you will have to create a .NET Core Console Application and install these three packages to get started: NUnit, NUnit3TestAdapter and Microsoft.NET.Test.Sdk.

The unit test providers now have their own settings pages where framework-specific settings can be tweaked. In addition, it’s possible to disable frameworks that are not in use or you don’t want to be visible in the Unit Test Explorer.
Unit test providers can be configured separately in Rider

We’ve also made various performance improvements for solutions with a large number of tests, as well as tests that produce a lot of output (including word wrap). A few minor changes went in the UI as well.

NuGet updates

A number of updates went into Rider’s NuGet client. We’re now using NuGet 4.3 under the hood, which brings full support for SemVer2 and .NET Core 2.0. Rider adds support for wildcard versions in package references, too.

When referencing packages that are not targeting .NET Core 2.0 (but are known to work with it), the AssetTargetFallback property can be used to define “fallback” target frameworks for our project’s dependencies. By default, .NET Core 2.0 projects will have this property set to net461 – meaning that any NuGet package that is compatible with .NET Framework 4.6.1 or higher can be used without additional configuration. Rider now also includes (initial) support for this.

Want to install a CLI tools package? No more need to manually edit the .csproj file and add a DotNetCliToolReference. We can now install any tools package right from within the NuGet client, for example the Entity Framework Core’s database migration commands from Microsoft.EntityFrameworkCore.Tools.DotNet.
Install .NET Core tools package

We made some UI changes as well, for example the ability to switch the position of the package details pane (as we can see in the above screenshot). And when possible, package icons will be rendered in high DPI making everything look more crisp.

Debugger updates

As with almost everything in this first Rider 2017.2 EAP build: the debugger now supports .NET Core 2.0. Next to that, we added a new tool window for visualizing Parallel Stacks, made it easier to add watches and added the ability to mark a specific object in the debugger.

The Debug tool window now has a new tab available: Parallel Stacks. When debugging multithreaded applications, it lets us visualize the various threads that are active while debugging, as well as their call stack.
Visualize parallel stacks while debugging

Similar threads are grouped together, but we can use the toolbar buttons to re-order the diagram if needed. We can hover over a thread to see their child threads. From the toolbar, we can jump to the active frame (or Ctrl+Space in the Visual Studio keymap). Double-clicking an entry in the call stack will jump to source. And when stepping through code, the diagram will be updated depending on threads that are being started/joined:
Parallel Stacks debugging in action

There are more updates to the debugger! For nested items (e.g. properties of a property of an object, or elements in a collection), we can now easily add a watch to inspect a specific variable or expression that interests us. In the below example, Rider will add a watch for results[1].Author.
Add nested object to watches

When debugging applications that have lots of variables, we may want to “mark” those that interest us. This can now be done using the context menu (or Ctrl+K, K in the Visual Studio keymap). We can even select the color we want to mark our variable with! Marking variables makes it really easy to discover where the variable is used, for example in fields of other objects.
Mark an object in the debugger

Do check our series on debugging to learn more about debugging in Rider!

Refactoring

A couple of new refactorings were introduced in Rider 2017.2 EAP. One of them is Transform Parameters. It lets us create a new class or struct and converts parameters of the selected method into encapsulated fields of the newly created type. Let’s use Refactor This (Ctrl+Shift+R in Visual Studio keymap) to invoke the refactoring:
Transform parameters refactoring

After applying the refactoring, usages of parameters are converted into usages of properties of the type being created. Note that this refactoring also allows getting rid of out parameters by introducing a tuple object return type.

Another refactoring that was added is Invert Boolean. This refactoring lets us automatically invert a boolean member and transform true to false and rewrite all usages to invert the boolean logic.
Invert Boolean refactoring

C# 7.0, 7.1, and more from latest ReSharper

Rider 2017.2 comes with ReSharper 2017.2 as its engine for providing .NET support. This means a number of features announced with ReSharper 2017.2 are now available in Rider. Examples include improved support for C# 7.0 (including pattern matching and out variables), and initial support for C#7.1. Rider now supports the default literal, tuple projection initializers, async main and pattern matching with generics. Simply reference the latest compiler package and make sure to set the language level in your project file.
C# 7.1 support in Rider

Rider also adds some new code inspections around IEnumerable, and will check XML documentation inheritance to make sure it is valid. This ensures documentation in the IDE as well as generated API documentation is correct.

Other improvements

In terms of Unity support, We have updated the debugger and added support for debugging different Unity processes. This change allows us to debug standalone games by remote debugging, such as running on the Mac or Windows desktop. The IDE and debugger now also support working with modularized UnityEngine dll’s.

The navigation bar received an update as well. In Rider 2017.1, it displayed contextual actions based on the file system. This allowed, for example, invoking a simple rename refactoring. Rider 2017.2 makes the navigation bar smarter, by relying on the same project model as the Solution Explorer. The Refactor This… context menu will have more information available, and also provide options like Adjust Namespaces and Move Types Into Matching Files.

Download Rider 2017.2 EAP and give it a try! We would love to hear your feedback on new and improved functionality.

image description