mac-搭建.net开发环境

1.install openssl

brew update
brew install openssl

2.去官网install .net core sdk

sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.2/System.Security.Cryptography.Native.dylib 

3.去官网install vs code
install c# extension:打开vs code,按command+p,在里面输入

ext install csharp

4.测试

mkdir HelloWorld
cd HelloWorld
dotnet  new
dotnet restore
dotnet run

效果

Project HelloWorld (.NETCoreApp,Version=v1.0) will be compiled because expected outputs are missing
Compiling HelloWorld for .NETCoreApp,Version=v1.0

Compilation succeeded.
    0 Warning(s)
    0 Error(s)

Time elapsed 00:00:01.4283528


Hello World!

5.使用vs code打开刚创建的HelloWorld,根据提示安装插件,最后效果

Updating C# dependencies...
Platform: darwin, x86_64

Downloading package 'OmniSharp for OSX' (24653 KB) .................... Done!
Downloading package '.NET Core Debugger (macOS / x64)' (43967 KB) .................... Done!

Installing package 'OmniSharp for OSX'
Installing package '.NET Core Debugger (macOS / x64)'

Finished
Failed to spawn 'dotnet --info'
Warning: project.json is no longer a supported project format for .NET Core applications. Update to the latest version of .NET Core (https://aka.ms/netcoredownload) and use 'dotnet migrate' to upgrade your project (see https://aka.ms/netcoremigrate for details).

参考资料
http://www.cnblogs.com/gk0124/p/6066857.html
http://blog.csdn.net/x_studying/article/details/52730913

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值