Deepin 下 使用 Rider 开发 .NET Core

2022-10-13,,,,

目录

  • deepin 下 使用 rider 开发 .net core
    • 安装 rider
    • 安装 .net core sdk

deepin 下 使用 rider 开发 .net core

国产的 deepin 不错,安利一下。

deepin 用了也有一两年,也只是玩玩,没用在开发上面。后来 win10 不太清真了,就想着能不能到 deepin下撸码。要搞开发,首先少不了 ide,vs2019 用不来,vs code 太复杂、麻烦,后来发现了 rider 这个神器,可是 rider 是英文界面,笔者的英文是渣渣的。结果在 windows 下 使用 rider 开发一段时间后, 已经熟悉了 rider ,于是计划后面迁移到 deepin 下开发 .net core 。笔者装了双系统 windows10 + deepin 15。

安装 rider

rider 的linux 下载地址

下载压缩包后,将压缩包解压,打开 bin 目录,在目录下打开终端,运行

sh rider.sh

或者直接点击 rider.sh 文件,选择执行即可。

之后会弹出安装界面。

根据提示一步步安装。

最后会要求输入账号密码或者激活码激活 rider 。

我这个是高材生的福利~你们没有的话就用 github 开源项目免费申请使用,或者其他手段激活。

安装完毕后,点击 new solution ,发现只能创建 .net frameork 的项目(mono)。

先关闭 rider ,接下来安装 .net core

安装 .net core sdk

有两种安装方法

  1. 自己下载二进制的 安装包

  2. 使用软件包形式安装

    无论哪种方法,如果不把 sdk/runtime 放到 /usr/share/dotnet 下,rider 是无法识别的(默认路径,可以进入rider修改设置),下面两种方法都是在 linux 简单二进制安装 .net core sdk的方法。

sudo ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet -f
export dotnet_root=/usr/share/dotnet export 
path=$path:/usr/share/dotnet

推荐第一种方法,第二种方法的或,可以按照微软的文档自己试试。。。

安装完毕后就是这个样子。

如果要通过软件包形式安装,参考一下这里 

体验开发

想不到在 deepin 下,rider 竟然支持 desktop application(wpf)。

不过这不是重点,我又不会 wpf,先试一下 asp.net core ,晚一点再看看 wpf。

运行的时候,报这个错,是 https 证书的问题,只需要任意位置打开终端,输入下面的命令即可。

dotnet dev-certs https

不知道为什么,浏览器打开 blazor 应用一片空白。。。

换成 mvc 试试。

不知道为什么 blazor 打开会空白。不管了,试试 desktop application。

创建 wpf 项目后,提示要安装插件,然后退出重新打开。

不过最后重新打开项目还是报错

project 'wpfapp1' load finished with warnings
            the imported project "/usr/share/dotnet/sdk/3.0.100/sdks/microsoft.net.sdk.windowsdesktop/targets/microsoft.winfx.targets" was not found. confirm that the path in the <import> declaration is correct, and that the file exists on disk.  /usr/share/dotnet/sdk/3.0.100/sdks/microsoft.net.sdk.windowsdesktop/targets/microsoft.net.sdk.windowsdesktop.targets at (26:3)
            windows is required to build windows desktop applications. at (59:5)

算了~就这样好了,反正我又不会 wpf ~

本文是使用 typora 写的,很清真。

好好学习呗~

最后录了个视频玩,不知道说啥,看看内容界面就好~

打不开的话,请点击 http://player.youku.com/embed/xndqzodgzmzk3ng==

《Deepin 下 使用 Rider 开发 .NET Core.doc》

下载本文的Word格式文档,以方便收藏与打印。