99 ASP.NET CORE WINDOWS开发环境搭建 - xiaoxin01/Blog GitHub Wiki
本文介绍如何在windoes下搭建ASP.NET CORE开发环境及Linux部署环境
安装工具可以选择VS Code,也可以选择VS Studio Community(安装后无需再安装SDK),建议使用VS Code,开源免费轻量级且跨平台。
下载vs code,.NET Core sdk:
https://www.microsoft.com/net/core#windowscmd
目前最新版:vs code 1.13,.NET Core 1.1
vs code调试.net core的代码需要额外安装插件:c#,直接在externsions中输入 @sort:installs 列出常用插件就可以看到。
windows本身没有git源代码管理工具,可以下载git scm:
https://www.git-scm.com/download/win
目前最新版本为2.13.2
如果很慢的话可以从百度盘下载:
https://pan.baidu.com/s/1c2xd1ss
也可以下载图形化管理工具:SourceTree:
https://www.sourcetreeapp.com/
目前SourceTree只有windows和mac版本,还没有Linux版。
https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_workstation_player/12_0
http://releases.ubuntu.com/trusty/
安装会比较久时间,建议安装好之后,把vm虚拟文件复制一份做备份,Server搞坏了,可以直接复制过来,比安装快。
另外进入ubuntu之后要注意不要使用VMware的关机,而要在server里面用sudo shutdown -P 0来关机,不然可能会造成无法正确引导进入ubuntu的问题。
sudo apt-get install curl openssh-server ca-certificates postfix
参照 xxxxx
参照xxxxx
目的是为了方便将windows开发环境的代码复制到Linux进行部署和验证,避免频繁提交代码版本
- 检查是否已经有SSH Key存在
windows:
type "%userprofile%\.ssh\id_rsa.pub"
Linux:
cat ~/.ssh/id_rsa.pub
如果存在,则进入第3步。
- 创建SSH keys
打开 git bash,输入:
ssh-keygen -t rsa -C "GitLab" -b 4096
全部默认值,回车
- 将SSH Key添加到git账号中
windiws运行下面指令会把公钥复制到剪贴板,然后粘贴到gitlab的user profile里面即可。
type "%userprofile%\.ssh\id_rsa.pub" | clip
linux运行之后再手动复制:
cat ~/.ssh/id_rsa.pub