Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

insert on ubuntu18.04 #46

Open
lotapp opened this issue Jun 19, 2018 · 0 comments
Open

insert on ubuntu18.04 #46

lotapp opened this issue Jun 19, 2018 · 0 comments

Comments

@lotapp
Copy link

lotapp commented Jun 19, 2018

之前说有机会就说下Linux下如何搭建C#版的交互编程,今天写篇文章还债^_^

Win下比较简单,可以自己看官方文档https://github.com/zabirauf/icsharp/wiki/Installation下面逆天带搭建搭建下Linux下的环境(官方方法有问题)

CSharp交互式编程

1.安装mono部分组件

先看看官方仓库,如果你不是Ubuntu的自己切换下源

安装mono部分组件,写段shell脚本,然后bash installmono.sh 直接执行

代码如下:

# add Ubuntu 18.04 repository
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# 更新一下
sudo apt-get update -y
# 安装 mono-complete
sudo apt-get install mono-complete -y
# 安装 mono-dbg
sudo apt-get install mono-dbg -y                 
# 安装 mono-runtime-dbg
sudo apt-get install mono-runtime-dbg -y
# 导入证书
mozroots --import --machine --sync
# 查看mono版本
mono --version

看到这个就代表安装完成了

2.安装Jupyter-notebook

这部之前说过了,你安装了conda之后什么都有了,可以参考之前我写的一篇文章:

Anaconda For Linux

3.环境配置

下载release包:
https://github.com/gyurisc/icsharp.kernel/releases/download/v1.0-beta/icsharp_kernel_v1.0.zip

然后移动到/opt/目录下(装软件一般都放这)
现在你可以运行icsharp了:mono icsharp.exe

4.编写代码

新建一个C#的ipynb文件

输入代码,shift+回车运行

其他的自己摸索摸索吧,先这样了~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant