Rider : The .NET Tools Blog | The JetBrains Blog https://blog.jetbrains.com Developer Tools for Professionals and Teams Tue, 20 Jun 2023 09:10:42 +0000 en-US hourly 1 https://blog.jetbrains.com/wp-content/uploads/2023/02/cropped-icon-512-32x32.png Rider : The .NET Tools Blog | The JetBrains Blog https://blog.jetbrains.com 32 32 Rider 2023.2 EAP 5: Improved Support for C#, Better Performance Profiling, and More. https://blog.jetbrains.com/dotnet/2023/06/16/rider-2023-2-eap-5/ Fri, 16 Jun 2023 15:11:51 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/06/Blog_Featured_image_1280x600-1.png https://blog.jetbrains.com/?post_type=dotnet&p=363862 The latest installment in our Early Access Program for Rider 2023.2 is here. But before you download this build, let’s go over the most important updates it contains.

C# support

Support for default parameter values in lambdas

As part of our work on supporting C# 12 language updates, we’re introducing support for default parameter values in lambda expressions in Rider 2023.2. In addition to the standard set of warning messages associated with recognizing this syntax, we’ve also tweaked an existing inspection, The parameter has the same default value, to account for default parameter values in lambdas. This inspection will also be triggered when an invocation has an argument value that is the same as the default value of the parameter in the invoked delegate, making the expression redundant.

New inspections for improved control over object disposal

Rider 2023.2 introduces two new code inspections designed to address scenarios where the state of a returned object may be negatively influenced by its early disposal or the early disposal of the object that spawned it.

When a variable is captured by a using statement, it ensures that the object is properly disposed of when it goes out of scope. Returning an object captured by a using statement can be problematic because it extends the lifespan of the returned object beyond the method scope, causing the object to be disposed of immediately after returning. This can lead to unexpected behavior and resource-related issues.

The Return of a variable captured by ‘using’ statement inspection alerts you in cases where the returned object is immediately disposed of.

Similarly, the Return of a task produced by ‘using’-captured object inspection identifies scenarios where a Task is produced by an object captured by a using statement and then immediately returned. To extend the lifetime of the disposable object enough for Task completion, a corresponding quick-fix will introduce asynchronous awaiting for that Task before its return. 

Terminal migration to ConPTY on Windows

JetBrains Rider includes an embedded terminal emulator to work with a command-line shell from inside the IDE. Previous versions of Rider relied on a third-party WinPTY library as a terminal emulation layer on Windows. For Rider 2023.2, we’re switching to the OS-provided ConPTY for versions of Windows that support it. While no visible changes are expected, the switch opens the door for further improvements to the terminal and the run console.

Performance profiling

Group by Thread for sampling, tracing, and line-by-line snapshots

The dotTrace Profiler inside Rider 2023.2 introduces the Group by Thread option and corresponding button in the Call Tree panel for performance snapshots. This option organizes sampling, tracing, and line-by-line snapshots based on individual threads, allowing for deeper insight into thread-specific performance issues. 

Using this grouping method can also give you a birds-eye view of the project’s performance, as the call trees with the most ancestors will end up at the top of the list, making any hotspots glaringly obvious. 

Once you’ve clicked on the Group by Thread toggle button, you will see the call trees organized by thread. You can navigate from one thread to another by using the keyboard, and the trees will expand at once. Red-colored percentage values to the left of the call tree indicate higher subtree power, helping you pinpoint potential performance bottlenecks at a glance. 

Notable fixes

  • We added support for the UE_INLINE_GENERATED_CPP_BY_NAME include, which improves compile time when added to your project’s .cpp file (RSCPP-34358).
  • We fixed a bug that caused the reformatting of project files after a user executed any project modification actions (RIDER-40468).

Known vulnerabilities

A vulnerability exists in .NET 6.0, .NET7.0, and NuGet where a potential race condition that can lead to a symlink attack on Linux. Non-Linux platforms are not affected.

Our team is aware of the issue, and we’re working on eliminating it.

For the full list of resolved issues, please refer to our issue tracker.

That’s it for now! Please share your feedback on the latest EAP builds of Rider in the comments below or on social media.

]]>
Blazor Essentials – New Guide Tutorial https://blog.jetbrains.com/dotnet/2023/06/13/blazor-essentials-new-guide-tutorial/ Tue, 13 Jun 2023 09:06:03 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/06/rs-how-tos-featured_blog_1280x720.png https://blog.jetbrains.com/?post_type=dotnet&p=359797 Want to learn Blazor? Then we have good news for you! On our JetBrains .NET Guide, we’ve just published the Blazor Essentials tutorial.

Blazor lets you to create progressive web apps using C#, having significantly less reliance on JavaScript that was necessary in previous versions of ASP.NET. This model is intended to make Blazor appealing to current C# developers, since they can focus less on JavaScript and write more in C# for full-stack development.

In the Blazor Essentials tutorial, we’ll explore Blazor, a Single Page Application (SPA) web framework that is part of ASP.NET Core. After covering some the basics, we’ll gradually look at working with forms, data, JavaScript interoperability, and more.

Tip: If you prefer regular ASP.NET Core with MVC or Razor pages, and a sprinkle of JavaScript, check out the HTMX for ASP.NET Core Developers.

Which SPA framework(s) are you using? Which do you prefer? Let us know in the comments!

]]>
Rider 2023.2 EAP 4 Is Out! https://blog.jetbrains.com/dotnet/2023/06/09/rider-2023-2-eap-4/ Fri, 09 Jun 2023 09:07:27 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/06/Blog_Featured_image_1280x600.png https://blog.jetbrains.com/?post_type=dotnet&p=362222 The latest EAP build for Rider 2023.2 has just been released and is available for download! Let’s take a look at what’s inside.

Improved navigation from var declarations

Rider 2023.2 EAP 4 introduces improved navigation from var keywords. 

It’s common for developers to have a variable with a wrapper type such as Nullable<T>, ValueTuple<T1, T2>, or KeyValuePair<TKey,TValue> in their code. Previously, navigating from a var keyword of such variables would immediately take a developer to declarations or usages of Nullable<T> instead of the underlying type they were looking for.

All navigation actions (Go to…, Find Usages, etc.) now suggest underlying types when navigating from var for common types used to wrap other types. For example, Rider will suggest navigating to Person when using the Go to declaration action from the var keyword of a variable with the ImmutableArray<Person>? Type.

User experience

Pinned run configurations in the Run widget

To make managing multiple run configurations easier, we’ve implemented the option to pin preferred configurations in the Run widget. To add a run configuration to the Pinned section, open the kebab menu (three dots) next to its name and select Pin. If you have multiple pinned configurations, you can easily rearrange them by dragging and dropping within the list. 

File sorting by modification time in the Solution Explorer 

Rider 2023.2 EAP 4 brings the long-awaited option to arrange your files in the Solution Explorer based on their modification time. This new functionality automatically reorders the files whenever the changes in your project are saved. To enable this feature, open the kebab menu (three dots) in the Solution Explorer and then select Tree Appearance | Sort by Modification Time.

Optimized Blueprint indexing for Unreal Engine

For Rider 2023.2, we’ve optimized the way Rider handles Blueprint indexing, leading to a drastic improvement in solution loading time.

By classifying Blueprints as secondary resources, Rider is now able to index all of your code before looking at your assets. This means you get access to the rich code editing experience sooner, while the assets are still being indexed in the background.

Click here to learn more about what Blueprints support in Rider has to offer. 

Docker Compose run configuration labels

Rider 2023.2 will make it easier for you to fine-tune the run configuration of Docker Compose through the introduction of labels. By adding these bits of code to the docker-compose.yml file, you can specify how and if you want to run and debug your applications.  

For example, if you want to disable the fast mode for some of your services, you can set a com.jetbrains.rider.fast.mode: "false" label for them. If you want to disable the debug mode, use with the label com.jetbrains.rider.debug: "false"

Web development

Volar support for Vue

Rider 2023.2 introduces Volar support for Vue to support the changes in TypeScript 5.0. This should provide more accurate error detection aligned with the Vue compiler. You can set the Vue service to use Volar integration on all TypeScript versions, under Settings / Preferences | Languages & Frameworks | TypeScript | Vue. By default, Volar will be used for TypeScript versions 5.0 and higher, and our own implementation will be used for TypeScript versions earlier than this.

Next.js custom documentation support

Next.js 13.1 now includes a plugin for the TypeScript Language Service specifically for the new app directory. This plugin offers suggestions for configuring pages and layouts, as well as helpful hints for using both Server and Client Components. It also comes with custom documentation, which means that it adds extra information to the output of the TypeScript Language Service. It’s now possible to view this custom documentation in Rider. 

CSS: Convert color to lch and oklch

Rider first introduced CSS color modification features back in version 2022.3. One of the applications for this is for changing rgb to hsl and vice versa. With our next release, we are expanding this support to include the conversion of lch and oklch with other color functions.

Working with databases

These are just a few of the updates available in the EAP 4 build:

  • More options for connecting with SSL certificates.
  • Use of HTTP proxy settings in the remote development process.
  • WSL support for dump tools.

Click here to learn more about these and all other updates for working with databases that will be coming to Rider 2023.2.  

Notable fixes

  • We’ve resolved the issue with the SSL certificate warning appearing on each startup when running Rider on macOS (RIDER-92026). 
  • We’ve fixed the Go to Symbol behavior where the action would sometimes open files without scrolling to the searched symbols (RIDER-9402).
  • The Separate Watches context action inside the debugger now correctly brings the Immediate Window into the view. Local variables and Immediate evaluation results are displayed in the panel to the left (RIDER-93888).

For the full list of resolved issues, please refer to our issue tracker.

That’s it for now! Please share your opinion on the latest Early Preview builds of Rider in the comments below or on social media.

]]>
How Docker Fast Mode Works in Rider https://blog.jetbrains.com/dotnet/2023/06/07/how-docker-fast-mode-works-in-rider/ Wed, 07 Jun 2023 12:21:54 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/rd-how-tos-blog-featured-image-1280x600-1-3.png https://blog.jetbrains.com/?post_type=dotnet&p=358605 JetBrains Rider’s Docker fast mode helps speed up the feedback loop when building, debugging, and running  containerized applications. With fast mode, Rider builds your application locally and then mounts it within a Docker container for a production-like experience.

In this post, we’ll look at what Rider is doing under the hood to make fast mode work, and how it launches your containers when you start a run configuration.

Faster feedback loops

Some developers prefer to run their container applications as regular .NET projects during development. A typical scenario would be to run their backing services (e.g. database, queue or something similar) with Docker Compose, open local ports, and then run the .NET project on their workstation.

The advantage of this approach is that it lets you apply changes to the application much faster. You don’t need to rebuild the application container image and wait for it. In other words, you get a much quicker response after making your changes.

The drawback is that it is inconvenient to have different Docker Compose files for different environments. For example, having the same configuration for all environments can lead to inadvertently opening development ports in production, exposing your application to malicious attackers. Keeping track of differences between environments can be a hassle. Ugh, so much to remember!

And this is where our Docker fast mode can help. We use the same Docker Compose and Dockerfiles that you use for all environments, but apply some overrides to start the container quicker during development. Let’s have a look.

Under the hood

JetBrains Rider’s Docker fast mode approach is based on Docker’s multi-stage build feature. In short, multi-stage builds create environment checkpoints that can be reused between rebuilds. Let’s look at an example of a common Dockerfile for an ASP.NET Core application:

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["WebApp/WebApp.csproj", "WebApp/"]
RUN dotnet restore "WebApp/WebApp.csproj"
COPY . .
WORKDIR "/src/WebApp"
RUN dotnet build "WebApp.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WebApp.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApp.dll"]

As you can see, there are several FROM instructions, also known as stages, with different names of base, build, publish, and final. Each stage can copy artifacts from other stages (for example, COPY --from=publish /app/publish .).

Now, why would you use different stages? 

The benefit is that you can use different base images for different stages. You can use the mcr.microsoft.com/dotnet/sdk image (almost 800 MB) to build the application and then use the mcr.microsoft.com/dotnet/aspnet image (about 200 MB) to create the final image that runs your application – copying the prepared artifact from the build stage. Therefore, the final image size will be much smaller than if you had used the sdk base image.

This is the multi-stage build technique, and it is quite common nowadays.

For Docker fast mode, we use it differently. You can specify the --target option to stop the build at a particular stage.

docker build -t web-app --target base .

Only the base stage will be built here.

Docker heavily uses caches when building the image; if there are no changes, Docker won’t do anything. And if you look at the first stage, there’s nothing to change.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

Thus, if we build this stage once, the following builds will be very fast.

But there is still one small problem… We don’t have our application inside the image. And we can’t build it inside because we’re using the base image mcr.microsoft.com/dotnet/aspnet rather than mcr.microsoft.com/dotnet/sdk, which comes with the full toolchain

The good news is that we can build the application on the host machine and then simply attach the folder to the container. Here you can see this volume attached to the container (under Volumes) from the Services tool window.

Finally, Rider modifies the entrypoint to run your application when the container starts.

You can check the entrypoint (["dotnet", "/app/bin/Debug/net7.0/WebApplication1.dll" ]) on the container’s Inspection tab.

That’s pretty much it. Rider also sets some useful environment variables in fast mode, and exports and attaches a certificate to the container. 

The final command line created in the background by Rider will look similar to this:

docker build -f .\WebApplication1\Dockerfile --target base -t webapplication1:dev . && docker run --name webapplication1 -v {Path to the WebApplication1 folder}:/app --entrypoint dotnet webapplication1:dev /app/bin/Debug/net7.0/WebApplication1.dll

Customizing Docker fast mode

If you need to include specific tools or configurations in your development container image without affecting your production image, you’re in luck! It is possible to manually specify the required stage using the MSBuild DockerfileFastModeStage property in the project file. 

Let’s look at an example. Imagine you want to include dotnet-counters to monitor some valuable metrics. No problem! You can add a new dev stage and install dotnet-counters.

FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM base as dev
RUN apt-get update && apt-get -y install curl
RUN mkdir /tools && cd /tools && curl -JLO https://aka.ms/dotnet-counters/linux-x64 && chmod +x ./dotnet-counters

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["WebApplication1/WebApplication1.csproj", "WebApplication1/"]
RUN dotnet restore "WebApplication1/WebApplication1.csproj"
COPY . .
WORKDIR "/src/WebApplication1"
RUN dotnet build "WebApplication1.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "WebApplication1.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "WebApplication1.dll"]

Next, add the DockerfileFastModeStage property to your project file:

<DockerfileFastModeStage>dev</DockerfileFastModeStage>

Rider will now use this dev stage to create a fast mode image, so you can run dotnet-counters inside the container. And since no other stages depend on this dev stage, the final image won’t contain these changes.

Conclusion

In this post, we discussed Docker fast mode and how it helps speed up your development feedback loop when debugging and running your application in a container. We’ve also seen how Rider modifies the Docker deployment to support Docker fast mode and can provide a faster way to run containers.

Download Rider and give it a try, and let us know how you’re using Docker fast mode!

]]>
Rider 2023.2 EAP 3: Improvements for Raw Strings, GitLab Integration, Memory Snapshot Analysis, and More https://blog.jetbrains.com/dotnet/2023/06/06/rider-2023-2-eap-3/ Tue, 06 Jun 2023 11:17:35 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-6.png https://blog.jetbrains.com/?post_type=dotnet&p=359214 The third installment in the Rider 2023.2 Early Access Program has just been released! But before you download the EAP 3 build, let’s go over the feature highlights included with it.

C# support

The C# language support features included in Rider 2023.2 EAP 3 are focused on improving your experience working with raw strings. The improvements include:

  • New code formatter options enabling you to align or indent the content inside of raw strings.
  • Typing assistance when using the Enter, Delete, or Backspace keys.
  • A new Use raw string inspection and a corresponding quick-fix to convert verbatim strings into their raw counterparts.
  • A new Raw string can be simplified inspection and a quick-fix to remove redundant quotes and dollar sign symbols.
  • Context actions to add or remove extra quotes and dollar sign symbols.
  • Context actions to switch between single-line and multiline representations of raw strings.

Since language support is shared between Rider and ReSharper, you can refer to the ReSharper 2023.2 EAP 3 blog post for more information.

UX/UI improvements

Reworked hamburger menu in the main toolbar on Windows and Linux

We’ve refined the behavior of the hamburger menu in the new UI that is located in the main toolbar for Windows and Linux. Once you click on the menu icon, the elements now appear horizontally over the toolbar.

Also, there’s now an option to turn this menu into a separate toolbar. For this, go to View | Appearance | Main menu as a Separate Toolbar.

Updated window controls on macOS 

When working on macOS in full screen mode using the new UI, the window controls are now displayed right in the main toolbar – not in the floating bar as before.

Light theme with light header in the new UI

For Rider version 2023.2, we’ve refined the user experience with the Light theme by introducing the alternate Light with Light Header option, featuring matching light colors for window headers, tooltips, and notification balloons.

Single-Click Navigation Between Project Directories

In the Solution Explorer tool window, there’s a new Open Directories with Single Click option that makes expanding and collapsing the project folders quicker and more responsive. The option is available from the drop down menu once you click on the three dots icon.

VCS

GitLab integration

Rider 2023.2 EAP 3 introduces initial integration with GitLab, allowing you to work with the Merge Request functionality right from the IDE and streamline your development workflow.

Memory snapshot analysis

dotMemory snapshot analysis is coming to Rider! Rider 2023.2 EAP 3 introduces several improvements and changes to the memory profiling workflow:

  • The Profiling Session view has been moved to the Document window in Rider, offering the same powerful features found in the standalone version of dotMemory. Now, you can manually capture snapshots or set conditions to automatically trigger snapshot collection.
  • Additionally, you can compare snapshots from the same profiling session. This enables you to easily identify changes and trends in memory usage over time, helping you pinpoint potential performance bottlenecks.
  • Rider 2023.2 EAP 3 introduces basic views to help you analyze Object sets and Object instances. While we continue to expand the range of available views, you can already explore the essential information inside the IDE.
  • The Memory Allocations view has been moved to the Document window. Meanwhile, the Memory Profiler tool window, where it originally could be found, has received some tweaks. You can now open, copy, and delete analysis tabs within the selected workspace. Also, if all analysis tabs are closed, you can stop the profiling session right from the tool window.

The features described above are available on Windows, Linux, and Mac OS, with the exception of the Import Process Dump command, which is currently exclusive to Windows. You can now import the process dump using the corresponding button in the Workspaces list within the Memory Profiler tool window.

And that’s it for now! For the full list of changes included in this EAP build, please refer to our issue tracker.

Just a quick reminder on how you can join the Rider 2022.3 Early Access Program:

  • Download and install the EAP build from our website.
  • Use the Toolbox App.
  • Install this snap package from the SnapCraft store if you are using a compatible Linux distribution.

We always appreciate your feedback. Please feel free to share it in the comments below, in our issue tracker, or on social media.

]]>
Cecil Phillip – Building payment flows with Stripe and Azure – Webinar Recording https://blog.jetbrains.com/dotnet/2023/06/02/cecil-phillip-building-payment-flows-with-stripe-and-azure-webinar-recording/ Fri, 02 Jun 2023 10:00:35 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-5.png https://blog.jetbrains.com/?post_type=dotnet&p=359376 The webinar recording for Building payment flows with Stripe and Azure, with Stripe Staff Developer Advocate, Cecil Phillip, is now available on JetBrainsTV. Be sure to like and subscribe on YouTube for more great content like this.

Content creators, businesses, and even developers are trying to find ways to connect with their customers and maximize revenue. How can we convert your audience into eager paying customers? To reach this goal, accepting payments must be as smooth as possible on both the front and back end.

In this session, we’ll discuss some things you should consider when adding payments to your .NET applications. We’ll talk about the importance of PCI compliance and alternative payment methods you should consider. Lastly, we’ll see how to scale your fulfillment workflow using serverless functions.

Session Notes
Some (extra) things Cecil will cover in this session:

  • Modeling workflows using Durable Functions
  • Handling webhooks event with Azure Service Bus
  • Connecting customer account with its associated user (Using IdentityServer)

Get the demo at Cecil’s GitHub repository.

Agenda

About the presenter:

Cecil Phillip

Cecil Phillip

Cecil Phillip is currently a Staff Developer Advocate at Stripe, with experience with .NET, JavaScript, Python, and serverless computing.

]]>
Level Up with Live Templates in JetBrains Rider https://blog.jetbrains.com/dotnet/2023/05/30/level-up-with-live-templates-in-jetbrains-rider/ Tue, 30 May 2023 12:39:17 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/02/rd-how-tos-blog-featured-image-1280x600-1-1.png https://blog.jetbrains.com/?post_type=dotnet&p=321815 Let’s face it. There are parts of programming that are tedious and repetitive. JetBrains products help reduce boilerplate by offering generalized quick fixes and templates that benefit the most developers. That said, you’re likely to have unique code structures and patterns for your projects that only you and your team utilize. 

Wouldn’t it be great to create a set of specialized templates for you and your team to use throughout the development of your applications? Well, with live templates, you can do just that.

This post will show you how to create a new live template with placeholder variables and share the templates with other project members.

What is a live template?

A live template is a block of code that you can expand into commonly-used constructs such as loops, conditions, declarations, or statements. In the context of JetBrains IDEs, live templates have a key associated with them to make expanding them memorable and accessible.

Additionally, live templates fall into two categories: Simple templates and Parameterized templates.

Simple templates contain only fixed plain text and are used to reduce keystrokes in generating boilerplate. Parameterized templates include variables that enable a secondary step of replacing input fields with calculated values based on file-type context or having you specify values manually.

All live templates can be limited to a specific context using categories like language or file extension. This flexibility ensures live templates are only available when and where you want them.

Create a new live template

For this example, you’ll author a new “rec” live template, allowing you to create a record definition and set the name. This template will only be available in a C# context.

First, open JetBrains Rider’s settings and navigate to Editor | Live Templates | C#. Here, you’ll see all the existing live templates.

the Editor | Live Templates | C# settings in JetBrains Rider

Click the New Template button on the top right-hand side, next to the list of existing templates. You’ll want to change the following values of Shortcut to “rec” and Description to “create a C# record” while leaving all other settings on their default.

You’ll also want the following template on the left-hand side.

// Created At $DATETIME$
$MODIFIER$ record $NAME$($END$);

Once you’ve pasted the template, let’s change the macros for each placeholder by clicking the Edit variables button on the bottom right. Be sure to match the following order and settings below.

PlaceholderEditableDescription
$DATETIME$ UncheckedCurrent date and time in specified format
$MODIFIER$CheckedExecute basic completion
$NAME$CheckedNo macro selected

These template variables can be used in your live template and will be either populated automatically or serve as a placeholder that you can Tab ⇥ into when using your live template later on.

You’ll notice $END$ is not in the list of variables. That’s because $END$ is a reserved variable that indicates the final place for your cursor.

The final look of the live template in settings

Now we can start using our new live template! In a C# file, start typing “rec”, and you’ll see the live template you created, at which point you can press enter to start expanding the template. Check out the video below to see it in action.

showing the live template in action within JetBrains Rider

Sharing live templates

Live templates can be shared with other team members using JetBrains Rider’s layer-based settings. Follow the same steps you used in the previous section, but before clicking the save button, be sure to use the dropdown to select the team-shared option, which will save your newly created live template to a <SolutionName>.sln.DotSettings file at the root of your solution.

Showing the save menu in JetBrains Rider and the team-shared option.

If you don’t see your live template content in the .DotSettings file, try deleting the live template and recreating it again. JetBrains Rider will only save differences between personal and team-shared environments. Be sure to check in the .DotSettings file into source control to share the template with team members.

Conclusion

Live templates are a powerful feature of JetBrains Rider, and while you’ve likely used our templates, you’ve probably never created your own. Live templates allow you to share knowledge across teams. You can also use them personally to improve webinars and live demos by cutting out all that unnecessary typing. We hope this short tutorial gives you the courage to try and experiment with live templates and the idea of sharing them with team members.

Please comment below if you have any live templates you’d like to share.

References

Image Credit: Thomas Despeyroux

]]>
https://blog.jetbrains.com/zh-hans/dotnet/2023/05/30/level-up-with-live-templates-in-jetbrains-rider/ https://blog.jetbrains.com/ja/dotnet/2023/05/30/level-up-with-live-templates-in-jetbrains-rider/
Rider 2023.2 EAP 2: Hot Reload for MAUI, Reworked Build Tool Window, Improvements for Source Generators, and More https://blog.jetbrains.com/dotnet/2023/05/22/rider-2023-2-eap-2/ Mon, 22 May 2023 08:54:23 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-6.png https://blog.jetbrains.com/?post_type=dotnet&p=356759 Hello everyone, 

A new EAP build for Rider 2023.2 has just landed and it’s incredibly feature-rich! Let’s take a look at the most notable updates. 

C# updates

Rider 2023.2 comes with new inspections and quick-fixes for common Entity Framework issues, such as the “N+1” problem and queries returning incomplete data. For the full details, check out this blog post for Resharper 2023.2 EAP 2.

Reworked Build tool window

Building solutions containing multiple projects has historically been one of the most CPU- and memory-intensive tasks for Rider. Not only did it take more time and memory than it had to, but the IDE would occasionally freeze once the job was complete, making it impossible to investigate the technical insights of the build. 

For Rider 2023.2, we’re reworking the Build tool window, both in terms of performance and UX/UI. Build output results will now be presented as an event tree on the left-hand side and a log on the right. The output will be loaded in a “lazy” manner, meaning only the build details you choose to look into from the event tree will be loaded and displayed, making it far more CPU-friendly and easier to navigate. 

Other UX/UI improvements are also on the way and will be available in future EAP builds. We hope you’ll try them and share your feedback with us!

XAML Hot Reload for MAUI

Hot Reload is finally available for solutions targeting .NET MAUI! 

Having XAML Hot Reload in Rider allows mobile developers to make changes to the UI and code of their MAUI apps while they’re running, without requiring a full rebuild and redeployment. The updated changes are applied immediately, providing a faster and more iterative development experience. 

Colorized instances [New UI]

With Rider 2023.2 you can navigate between all of your open projects by color! 

Working on multiple solutions simultaneously can be disorienting when all of your IDE windows look the same. Now, with the new UI enabled, Rider will colorize the header of each of its open windows to help you instantly find the one you need. 

This setting is switched on by default in the new UI. You can disable it by going to Settings / Preferences | Appearance

Improvements for Source Generators 

Developers relying on custom source generators often encounter freezes due to conflicts between Roslyn, Rider, and the Source Generators themselves, which forces users to restart Rider. To mitigate this issue, we’ve added a Reboot Source Generators button so you don’t have to restart the entire IDE if a freeze occurs.

Rider 2023.2 will now also display source generator exceptions in Problems view, enabling you to zero in on the issues that would have previously gone undetected or unexplained. 

Feature Trainer for Rider

Rider 2023.2 introduces the Feature Trainer, a new interactive tool designed to familiarize both new and existing users with the extensive features and workflows offered by the IDE. The Feature Trainer employs a hands-on learning approach, providing step-by-step instructions and sample code to practice on. Give it a try by going to Help | Learn IDE Features. The Feature Trainer is only available in the new UI. 

As of Rider 2023.2 EAP 2, the IDE offers tutorials on code editing, navigation, refactoring, and the basics of working with Git. We’ll be expanding the list of workflows covered, so please feel free to leave your request here.

Settings Sync plugin

For quite some time, there were two plugins that existed in parallel and featured intersecting functionality: the IDE Settings Sync and Settings Repository plugins. 

To avoid the confusion caused by having two similar bundled plugins, we’ve merged their feature sets into a single solution: the new Settings Sync plugin. 

To enable setting synchronization or maintain it after the merge, go to Settings / Preferences | Tools | Settings Sync and click on Enable Settings Sync

Starting with this EAP 2 build, the Settings Repository plugin will no longer be bundled with Rider, but it can still be installed from JetBrains Marketplace. If the plugin was enabled in previous versions, a notification will appear the first time you start Rider after an update, recommending that you either install the Settings Repository plugin or enable the Settings Sync plugin.

We’re aware of the following issues with new UI synchronization: IDEA-303622 and IDEA-320082.

Other changes included in this build:

  • Rider 2023.2 supports language injections for F#. You can learn more about  language injections from this blog post.
  • We’ve resolved the issue of the missing device selection option for Xamarin plugins in the new UI (RIDER-85303).
  • Support for pattern variables inside the debugger has been improved. Rider can now unwrap patterns, evaluate, and show the value of the member you hover over.
  • Rider will now include Unreal Engine plugins and module scopes in the Project filter when you execute the Find in Files command.
  • The IDE now properly recognizes the properties and variables from Unity’s UI Toolkit (USS).
  • We resolved the issue where Find asset usage from Rider could not focus on the searched object inside the Unity Editor (RIDER-91090).

For the full list of features and fixes that made it into Rider 2023.2 EAP 2, please refer to our issue tracker.

Just a reminder: there are a few ways you can download and install the latest preview build for Rider:

  • Download and install the EAP build from our website.
  • Use the Toolbox App.
  • Install this snap package from the SnapCraft store if you use a compatible Linux distribution.

As always, we can’t wait to hear your feedback! Tell us what you think about the new features in the comments below or on Twitter

]]>
Webinar – Cecil Phillip – Building payment flows with Stripe and Azure https://blog.jetbrains.com/dotnet/2023/05/19/webinar-cecil-phillip-building-payment-flows-with-stripe-and-azure/ Fri, 19 May 2023 10:22:30 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-5.png https://blog.jetbrains.com/?post_type=dotnet&p=356597 Join us Thursday, June 1st, 2023, 3:00 – 4:00 PM UTC (check other timezones) for our free live webinar, Building payment flows with Stripe and Azure, with Staff Developer Advocate, Cecil Phillip.

Register now and get a reminder, or join on YouTube

Content creators, businesses, and even developers are trying to find ways to connect with their customers and maximize revenue. How can we convert your audience into eager paying customers? To reach this goal, accepting payments must be as smooth as possible on both the front and back end.

In this session, we’ll discuss some things you should consider when adding payments to your .NET applications. We’ll talk about the importance of PCI compliance and alternative payment methods you should consider. Lastly, we’ll see how to scale your fulfillment workflow using serverless functions.

Session Notes
Some (extra) things Cecil will cover in this session:

  • Modeling workflows using Durable Functions
  • Handling webhooks event with Azure Service Bus
  • Connecting customer account with its associated user (Using IdentityServer)
Cecil Phillip - Building payment flows with Stripe and Azure

You can attend Cecil Phillip’s webinar on YouTube or register for Building payment flows with Stripe and Azure to get a reminder closer to the webinar.

About the presenter:

Cecil Phillip

Cecil Phillip

Cecil Phillip is currently a Staff Developer Advocate at Stripe, with experience with .NET, JavaScript, Python, and serverless computing.

]]>
ReSharper and Rider 2023.1.2 – More Bug-fixes Released https://blog.jetbrains.com/dotnet/2023/05/17/rsrp-and-rider-2023-1-2-bug-fixes/ Wed, 17 May 2023 17:29:48 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/rs-bug-fix-blog-featured-image-1280x600-1-1.png https://blog.jetbrains.com/?post_type=dotnet&p=355762 Hello everyone,

ReSharper and Rider have just received their second set of bug-fix updates for the 2023.1 release! Let’s take a look at the most crucial issues resolved.

ReSharper

  1. ReSharper and Visual Studio would crash if there was a $ symbol before a string (RSRP-492006).
  2. The Convert To List Pattern quick-fix broke code that dealt with arrays (RSRP-491638).

Rider

  1. Rider was hanging after updating to 2023.1 (RIDER-92254).
  2. The IDE would freeze when the user created a baker before including Unity.Entities in a Unity project (RIDER-92309)
  3. .NET Framework projects in the .csproj format weren’t being built after upgrading to 2022.3.1 (RIDER-87113).
  4. The Options and Hide buttons in the Debug window disappeared after disabling the New UI (RIDER-84418).
  5. Rider was showing the VSTS Device Code Authentication dialog repeatedly and failed to get a token (RIDER-91953).
  6. Hot Reload was not working for layout changes in ASP.NET Core MVC apps on macOS (RIDER-69650).
  7. Language injections were interfering with the Undo action (RIDER-85801).
  8. Remote debugging would not allow you to upload the debug tools (RIDER-86140).
  9. Rider was sometimes unable to debug Docker Compose (RIDER-92541).
  10. #r “nuget: PackageName” was not working for F# script files (RIDER-86308).
  11. Unreal projects loaded from .uproject failed to show game configurations (RIDER-87087).
  12. There was a problem with debugging Azure functions in an isolated worker launched under Rosetta (RIDER-92326).
  13.  Editor tabs would scroll very slowly (IDEA-318576).
  14.  The Build button had an incorrect layout in the new UI (IDEA-304472).

For the full list of issues resolved in this build, please refer to our issue tracker.

You can download Rider 2023.1.2 and ReSharper 2023.1.2 from our website or update either product by using the Toolbox App. You can also update Rider as a snap for Ubuntu.We would appreciate your feedback on the new versions! Please don’t hesitate to share your thoughts in the comments below or on Twitter (ReSharper, Rider).

]]>
Rider 2023.2 Early Access Program Is Now Open https://blog.jetbrains.com/dotnet/2023/05/15/rider-2023-2-eap1/ Mon, 15 May 2023 13:42:02 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-3.png https://blog.jetbrains.com/?post_type=dotnet&p=354065 Hello everyone,

We hope that you checked out the roadmap blog post we published last week and you’re just as excited about Rider 2023.2 as we are. If so, you’re in luck! The first installment of Rider’s Early Access Program just went live, and you can try out some of the new features.

There are a few ways you can access preview builds:

Let’s take a look at the feature highlights of Rider 2023.2 EAP 1.

C# inspections for #nullable directives and NRT annotations

We’re kicking off the new cycle of C# language support development with the introduction of two new inspections that can counter the misuse of #nullable directives.

The new Redundant nullable directive inspection is designed to point out cases where the #nullable directive does not change nullable context and can be safely removed. The Unused nullable directive inspection deals with cases where there is no code affected by the #nullable directive. As always, both inspections come with corresponding quick-fixes for easy code cleanup.

New nullable directive inspections in Rider 2023.2

Another C# inspection we’re introducing in EAP 1 is designed to alert you to cases where nullable reference type (NRT) annotations contradict JetBrains.Annotations attributes on a base member.

NRT annotations alone can verify signature mismatches on inheritance only when both the base and derived types use nullable reference types. This leaves a dangerous gap in the nullability safety net when a project is only partially migrated to NRT or when it uses a third-party library that has only JetBrains.Annotations or external JetBrains.Annotations (for example, if its authors don’t want to migrate it to NRT). The new inspection will cover such cases, catching signature mismatches at the border of two different nullability annotation systems and making it harder for NullReferenceException exceptions to creep into your code. 

New inlay hints

Since code analysis is a shared functionality between ReSharper and Rider, you can find all of the details about the new inlay hints for Rider in this blog post.

Find Usages Advanced

In Rider 2023.2, the Find Usages functionality in Rider is receiving a functional upgrade. Now, if you invoke Find Usages Advanced on a symbol (such as a method, class, or variable), the IDE will display a window that will allow you to specify various additional search criteria.

For example, you can search for usages of the symbol in a particular scope or for usages that match a particular pattern (such as calls with specific arguments or types).

Being able to apply advanced search options allows you to quickly and precisely locate all of the usages of a symbol in your codebase that are relevant to your specific needs. This can give you better insight into your code, help to identify potential issues, and make more informed refactoring decisions.

Running Docker on WSL

Our latest release introduced fast mode running for Docker. Starting with Rider 2023.2 EAP 1, it’s possible to use Docker in fast mode on WSL. To run Docker containers on a Windows machine without Docker Desktop, you first need to install WSL, install Docker on your Linux distribution, and add WSL to your Rider Settings/Properties under Build, Execution, Deployment | Docker. Then you will be able to run and debug Docker containers on WSL (with or without Fast Mode).

UnrealHeaderTool code inspections fix for Unreal Engine

The first EAP build for Rider 2023.2 includes a fix for an issue that used to interfere with code analysis when using the UnrealHeaderTool on machines with no .NET 6 runtime installed. The fix circumvents the need to install any additional runtimes/SDK by using the one already bundled with Unreal Engine, allowing for the latest code inspections to be displayed in Rider correctly.

Improved code completion for Unity shader includes

We’ve added code completion support for packages when including files in shaders, so you will now see package names in the completion list when you start typing #include "Packages/…".

For the full list of resolved issues, please refer to our issue tracker.

That’s it for now! We hope that you’ll join us on the EAP journey over the next few weeks. As you continue to test the newest additions to Rider, please don’t hesitate to share your feedback with us here on the blog, on social media, or via our issue tracker.

]]>
JetBrains GameDev Day 2023 – Call for Speakers https://blog.jetbrains.com/dotnet/2023/05/15/jetbrains-gamedev-day-2023-call-for-speakers/ Mon, 15 May 2023 11:15:12 +0000 https://blog.jetbrains.com/wp-content/uploads/2023/05/Blog_Featured_image_1280x600-2.png https://blog.jetbrains.com/?post_type=dotnet&p=354671

In October 2023, we’re hosting another JetBrains GameDev Day – a free, live, virtual event where community speakers cover topics they are passionate about

Last year, we invited seven experts from various areas to give talks, hold discussions, and share pro tips on how to craft the best games. The event attracted over 4,000 online attendees! This year, we want to repeat our success and make the experience even better for all.

In 2023, we’re going hybrid. The whole event will be online, but we’ll also be hosting viewers in Cyprus, so you can join us there to watch the livestream together. We will share some details about that later, so stay tuned!

We are looking for speakers interested in presenting with us! We aim to bring valuable technical gamedev content mixed with speakers’ experiences with specific tools and technologies. We welcome all topics as long as they’re relevant to the gamedev tech community.

Submit a talk!

We’ll highlight you as a speaker and any resources you may want to share, such as your blog, open-source projects, online courses, and so on. All accepted speakers will also receive a complimentary 1-year personal subscription to the JetBrains All Products Pack.

GameDev Day at a glance

  • Talks are presented live, in English.
  • Talks can be 30, 45, or 60 minutes, followed by 5–10 minutes of Q&A (optional).
  • Talks are scheduled according to your time zone, meaning that speakers can pick a time that works for them.
  • Talks are presented live, recorded, published on YouTube, and shared in our newsletters, blogs, and social media.
  • You can show slides, do live demos, or whatever you think works best for your content.
  • All accepted speakers get a complimentary 1-year personal subscription to the JetBrains All Products Pack.
  • We are happy to help with dry runs, talk feedback, and smoothing out demos as part of preparation if you get selected.
  • Please make sure you read and adhere to the Code of Conduct prior to submitting.

What type of talks are we looking for?

We welcome topics that are relevant to the wider gamedev community. We’d appreciate some link to or mention of a JetBrains product, but your talk doesn’t have to be focused on it.

Some topics we’re always interested in:

  • Engine-related – how to get the most out of your favorite game engine, whether that’s Unreal, Unity, Godot, or any other.
  • Building your own game engine.
  • Language-related – new features in C++ or C# that will help with your project.
  • Debugging – how to quickly figure out why your game isn’t working properly.
  • Architecture – clean code vs performance requirements, etc.
  • Performance tuning, memory management, concurrency, benchmarking, logging, etc.
  • Testing – everything from unit testing to integration testing, and from automated to manual.
  • Open-source libraries that can make a big difference to gamedev.
  • Automated CI/CD processes for building, testing, publishing, and distributing your game.
  • Leveraging cloud computing in game development.
  • And anything else, as long as it’s interesting to our gamedev attendees!

To give you an idea, here are some talks from 2022 that were a hit:

  • Useful Game Developer Habits
  • Making Plugins for Game Engines as a Business
  • Unreal Engine Game Optimization
  • Unity Packages
  • Making UIs With C++ in Unreal Engine

More information is available on our Call for Speakers page. 

Not sure if your talk idea is a good fit? Reach out to matt.ellis@jetbrains.com and we can discuss.

We look forward to your talk submissions!

]]>