# JetBrains Rider 设置

1. 下载并安装 .NET SDK [下载 .NET (Linux, macOS, and Windows) (microsoft.com)](https://dotnet.microsoft.com/download)

   这是用于构建 `Avalonia` 应用程序的运行时开发工具包（编译器等）。
2. 安装 Avalonia 模板

   运行命令 `dotnet new install Avalonia.Templates` 从计算机上的命令提示符中选择模板。 或者SDK版本在.NET 7之前运行命令 `dotnet new -i Avalonia.Templates`。

   输出类似如下：

   ```bash
   $ dotnet new install Avalonia.Templates
     Determining projects to restore...
     Restored /Users/danwalmsley/.templateengine/dotnetcli/v5.0.200/scratch/restore.csproj (in 706 ms).

   Templates                                     Short Name            Language    Tags
   .....

   Avalonia Resource Dictionary                  avalonia.resource                 ui/xaml/avalonia/avaloniaui
   Avalonia Styles                               avalonia.styles                   ui/xaml/avalonia/avaloniaui

   Examples:
       dotnet new mvc --auth Individual
       dotnet new mstest
       dotnet new --help
       dotnet new avalonia.mvvm --help
   $
   ```
3. 下载并安装 [Rider: JetBrains 出品的跨平台.NET IDE](https://www.jetbrains.com/zh-cn/rider/)

   Rider 将为您提供 Avalonia 最佳的开发体验。它适用于 Windows、Linux 和 macOS 。

   Rider 支持 XAML 开箱即用。但是，如果您想使用 XAML 预览器，则需要使用 Avalonia 插件。
4. 安装 Avalonia 插件

   Rider 打开后，会看到欢迎页面。单击 `Configure` ，在下拉列表并选择 `Plugins` 。

![rider-welcome](/files/gPqnnPOCptPBAG4rTGP1)

这会打开一个新的 Preferences 页面。如图所示，单击 `Settings` 图标，然后选择 `Manage Plugin Repositories...`

![configure-plugin-repos](/files/R6FhLnACyE7KIFQfvNuz)

单击 `+` 图标并输入 URL `https://plugins.jetbrains.com/plugins/dev/14839` 之后点击 `OK`:

![enter-plugin-repo](/files/wKsn6RYPrf9fPLRiaEYZ)

现在单击 `Marketplace` 选项卡并搜索 `Avalonia`。选择 `AvaloniaRider` 并单击 `Install`；安装完成后，单击出现的 `Restart IDE` 按钮。

![plugin-install](/files/otjoRVn1GEVmena5Fb7y)

现在 Rider 已经能开发 Avalonia 应用程序了。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://avaloniachina.gitbook.io/avalonia/docs/getting-started/ide-support/jetbrains-rider-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
