因为您安装了 1.1.0 的 SDK/构建工具,但没有安装共享框架 1.1.0。
SDK 和共享框架不是一回事。
也许最好用 Linux 命令行来解释。
如果你有的话,你目前安装的是
apt-get install dotnet-dev-1.0.1
但你缺少的是
apt-get install dotnet-sharedframework-microsoft.netcore.app-1.1.0
更深层的原因是你有
apt-get install dotnet-dev-1.0.1
而不是
apt-get install dotnet-dev-1.1.0
SDK 1.1 版会安装共享框架 1.1.0,但如果你的 SDK 是 1.0.1,那么 1.1.0 从未安装过。
关于 netstandard 与 netcore,David Fowler 有一个很好的解释尝试 here。
基本上,“.NET Core Framework”和“.NET Framework non-core”的每个版本都扩展了 netstandard 的一个版本,其中 netstandard-library 可以在 CORE 和 NON-Core 中使用):
具体来说,您的应用只能作为 .NET Core 或 .NET Framework 运行。没有 netstandard-app(当前),只有 netstandard-libraries。
NetFramework_vX 和 NetCoreFramework_vX 都是 NetStandardLibray_vX 的超集。
using System;
namespace Analogy
{
// Each interface represents a target framework and methods represents groups of APIs available on that target framework.
// The goal is to show the relationship between .NET Standard API surface and other .NET platforms
// .NET Standard
interface INetStandard10
{
void Primitives();
void Reflection();
void Tasks();
void Collections();
void Linq();
}
interface INetStandard11 : INetStandard10
{
void ConcurrentCollections();
void InteropServices();
}
interface INetStandard12 : INetStandard11
{
void ThreadingTimer();
}
interface INetStandard13 : INetStandard12
{
void FileSystem();
void Console();
void ThreadPool();
void Process();
void Sockets();
void AsyncLocal();
}
interface INetStandard14 : INetStandard13
{
void IsolatedStorage();
}
interface INetStandard15 : INetStandard14
{
void AssemblyLoadContext();
}
// .NET Framework
interface INetFramework45 : INetStandard11
{
void FileSystem();
void Console();
void ThreadPool();
void Crypto();
void WebSockets();
void Process();
void Sockets();
void AppDomain();
void Xml();
void Drawing();
void SystemWeb();
void WPF();
void WindowsForms();
void WCF();
}
interface INetFramework451 : INetFramework45, INetStandard12
{
// TODO: .NET Framework 4.5.1 specific APIs
}
interface INetFramework452 : INetFramework451, INetStandard12
{
// TODO: .NET Framework 4.5.2 specific APIs
}
interface INetFramework46 : INetFramework452, INetStandard13
{
// TODO: .NET Framework 4.6 specific APIs
}
interface INetFramework461 : INetFramework46, INetStandard14
{
// TODO: .NET Framework 4.6.1 specific APIs
}
interface INetFramework462 : INetFramework461, INetStandard15
{
// TODO: .NET Framework 4.6 specific APIs
}
// Mono
interface IMono43 : INetFramework46
{
void MonoSpecificApi();
}
// Windows Universal Platform
interface IWindowsUniversalPlatform : INetStandard14
{
void GPS();
void Xaml();
}
// Xamarin
interface IXamarinIOS : INetStandard15
{
void AppleAPIs();
}
interface IXamarinAndroid : INetStandard15
{
void GoogleAPIs();
}
// .NET Core
interface INetCoreApp10 : INetStandard15
{
}
// Future platform
interface ISomeFuturePlatform : INetStandard13
{
// A future platform chooses to implement a specific .NET Standard version.
// All libraries that target that version are instantly compatible with this new
// platform
}
}