文章内容
2017/6/5 16:07:48,作 者: 黄兵
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
最近在用asp.net core 编写网站,部署在Unbutu上的时候出现了如下错误:
The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
没有找到这个版本的框架,如何解决这个问题呢?
在网上找了一下,解决方案如下:
1、首先查看一下版本:dotnet --info
Product Information: Version: 1.0.0-preview2-003121 Commit SHA-1 hash: 1e9d529bc5 Runtime Environment: OS Name: ubuntu OS Version: 16.04 OS Platform: Linux RID: ubuntu.16.04-x64
之后开始更新:
根据具体版本选择安装。
Install for Ubuntu 14.04, 16.04, 16.10 & Linux Mint 17, 18 (64 bit)
- 1
Add the dotnet apt-get feed
In order to install .NET Core on Ubuntu or Linux Mint, you need to first set up the apt-get feed that hosts the package you need.
Ubuntu 14.04 / Linux Mint 17
- sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ trusty main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
- sudo apt-get update
Ubuntu 16.04 / Linux Mint 18
- sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
- sudo apt-get update
Ubuntu 16.10
- sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet-release/ yakkety main" > /etc/apt/sources.list.d/dotnetdev.list'
- sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 417A0893
- sudo apt-get update
- 2
Install .NET Core SDK
Before you start, please remove any previous versions of .NET Core from your system by using this script.
To install .NET Core 1.1 on Ubuntu or Linux Mint, simply use apt-get.
.NET Core 1.1 is the latest version. For long term support versions and additional downloads check the all Linux downloads section.
- sudo apt-get install dotnet-dev-1.0.4
- 3
Initialize some code
Let's initialize a sample Hello World application!
- dotnet new console -o hwapp
- cd hwapp
- 4
Run the app
The first command will restore the packages specified in the project file, and the second command will run the actual sample:
- dotnet restore
- dotnet run
安装完成之后再次查看一下版本:
root@VM-62-122-ubuntu:/var/publish# dotnet --info
.NET Command Line Tools (1.0.4)
Product Information:
Version: 1.0.4
Commit SHA-1 hash: af1e6684fd
Runtime Environment:
OS Name: ubuntu
OS Version: 16.04
OS Platform: Linux
RID: ubuntu.16.04-x64
Base Path: /usr/share/dotnet/sdk/1.0.4
root@VM-62-122-ubuntu:/var/publish# dotnet NetNote.dll
warn: Microsoft.AspNetCore.Server.Kestrel[0]
Unable to bind to http://localhost:5000 on the IPv6 loopback interface: (Error -99 EADDRNOTAVAIL address not available)
Hosting environment: Production
Content root path: /var/publish
Now listening on: http://localhost:5000
Application started. Press Ctrl+C to shut down.程序已经运行起来了,飞奔吧!我的下马达**……。
本文参考网址:
1、The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
2、The specified framework 'Microsoft.NETCore.App', version '1.0.4' was not found
黄兵的个人博客原创。
转载请注明出处:黄兵的个人博客 - The specified framework 'Microsoft.NETCore.App', version '1.1.2' was not found.
评论列表