获取错误 Microsoft.AspNetCore.MVC 1.1.0 不支持框架 .NETCoreApp,版本 v1.1
Getting error Microsoft.AspNetCore.MVC 1.1.0 does not support framework .NETCoreApp, Version v1.1
正在尝试使用 MVC 启动 .Net CORE 项目。尝试使用最新版本的 .Net CORE (v1.1),我无法让 MVC 版本作为依赖项工作。下面是我的 project.json 文件。
{
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Relational": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dnxcore50"
]
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"runtimeOptions": {
"gcServer": true
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
出现此错误:
The dependency Microsoft.AspNetCore.Mvc 1.1.0 does not support framework .NETCoreApp,Version=v1.1
只需从此处安装运行时(不仅是 SDK):https://www.microsoft.com/net/download/core#/current/runtime。
也许您需要执行 "dotnet restore" 命令。
对我有帮助。
正在尝试使用 MVC 启动 .Net CORE 项目。尝试使用最新版本的 .Net CORE (v1.1),我无法让 MVC 版本作为依赖项工作。下面是我的 project.json 文件。
{
"buildOptions": {
"emitEntryPoint": true,
"debugType": "portable",
"preserveCompilationContext": true
},
"dependencies": {
"Microsoft.AspNetCore.Diagnostics": "1.1.0",
"Microsoft.AspNetCore.Mvc": "1.1.0",
"Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
"Microsoft.AspNetCore.StaticFiles": "1.1.0",
"Microsoft.EntityFrameworkCore": "1.1.0",
"Microsoft.EntityFrameworkCore.Design": "1.1.0",
"Microsoft.EntityFrameworkCore.Relational": "1.1.0",
"Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
"Microsoft.Extensions.Configuration.Json": "1.1.0"
},
"frameworks": {
"netcoreapp1.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.1.0"
}
},
"imports": [
"dnxcore50"
]
}
},
"publishOptions": {
"include": [
"wwwroot",
"web.config"
]
},
"runtimeOptions": {
"gcServer": true
},
"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}
出现此错误:
The dependency Microsoft.AspNetCore.Mvc 1.1.0 does not support framework .NETCoreApp,Version=v1.1
只需从此处安装运行时(不仅是 SDK):https://www.microsoft.com/net/download/core#/current/runtime。 也许您需要执行 "dotnet restore" 命令。 对我有帮助。