红联Linux门户
Linux帮助

.NET Core get started on Ubuntu 14.04

发布时间:2016-06-29 16:09:31来源:cnblogs.com/zhangzhi19861216作者:

.NET Core 1.0 正式发布了,所以尝尝鲜。

根据官方(https://www.microsoft.com/net/core#ubuntu)介绍页面的步骤:


步骤1.

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893
sudo apt-get update


步骤2.

sudo apt-get install dotnet-dev-1.0.0-preview2-003121


步骤3.

mkdir hwapp

cd hwapp

dotnet new


步骤4.

dotnet restore

dotnet run


结果出了不少问题:

问题1,由于网络原因,资源下载不下来——只能反复尝试。


问题2,执行dotnet run 时报错:

The specified framework 'Microsoft.NETCore.App', version '1.0.0-rc2-3002702' was not found.
- Check application dependencies and target a framework version installed at:
/usr/share/dotnet/shared/Microsoft.NETCore.App
- The following versions are installed:
1.0.0
- Alternatively, install the framework version '1.0.0-rc2-3002702'.
SUMMARY: Total: 1 targets, Passed: 0, Failed: 1.

问题2解决方法:

在步骤2后面,执行如下命令:

apt-get install dotnet-sharedframework-microsoft.netcore.app-1.0.0-rc2-3002702


解决上面问题后,再执行:dotnet run

结果如下图:

.NET Core get started on Ubuntu 14.04


本文永久更新地址:http://www.linuxdiyf.com/linux/21952.html