mac .net core尝试
以下是对.net core 发布的尝试,内容完全来自微软官方的文档粘贴,主要是用来记录尝试的过程。
下载
https://www.microsoft.com/net/download
.NET Core SDK = Develop apps with .NET Core and the SDK+CLI (Software Development Kit/Command Line Interface) tools
.NET Core = Run apps with the .NET Core runtime
安装 SDK
macOS 10.11 (El Capitan) or higher is required. There are known issues with OpenSSL 0.9.8 and oh-my-zsh
https://github.com/dotnet/core/blob/master/cli/known-issues.md
安装完后提示
1 | $dotnet --help |
创建链接
1 | ln -s /usr/local/share/dotnet/dotnet /usr/local/bin |
再次执行
1 | $dotnet --help |
具体的步骤参考 https://www.microsoft.com/net/core#macos
创建项目
1 | mkdir hwapp |
运行项目
1 | dotnet restore |
创建 website 入门
https://docs.asp.net/en/latest/getting-started.html
Install .NET Core
Create a new .NET Core project:
1 | mkdir aspnetcoreapp |
Update the project.json file to add the Kestrel HTTP server package as a dependency:
1 | { |
Restore the packages:
1 | dotnet restore |
Add a Startup.cs file that defines the request handling logic:
1 | using System; |
Update the code in Program.cs to setup and start the Web host:
1 | using System; |
Run the app (the dotnet run command will build the app when it’s out of date):
1 | dotnet run |
###Browse to http://localhost:5000:
mac .net core尝试