gpt4 book ai didi

asp.net-core - 依赖 microsoft.aspnetcore.mvc 1.0.0 不支持框架 .NETCoreApp,Version=v1.0

转载 作者:行者123 更新时间:2023-12-04 11:21:18 24 4
gpt4 key购买 nike

尝试创建一个 ASP.NET Core 项目,因为它刚刚达到 RTM。我使用名为“ASP.NET Core Web 应用程序 (.NET Core)”的 Visual Studio 2015 Update 3 模板创建了一个新项目。然后我去了 Nuget 包管理器并更新了所有 package.json打包到 1.0.0。 Visual Studio 无法还原包,并出现本文标题中的错误。

这是project.json更新 Nuget 包后:

{ 
"dependencies": {
"Microsoft.AspNetCore.Mvc": "1.0.0",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0",
"Microsoft.Extensions.Configuration.Json": "1.0.0",
"Microsoft.Extensions.Logging": "1.0.0",
"Microsoft.Extensions.Logging.Console": "1.0.0",
"Microsoft.Extensions.Logging.Debug": "1.0.0",
"Microsoft.NETCore.App": "1.0.0"
},

"tools": {
"Microsoft.AspNetCore.Server.IISIntegration.Tools": {
"version": "1.0.0-preview-final",
"imports": "portable-net45+win8+dnxcore50"
}
},

"frameworks": {
"netcoreapp1.0": {
"imports": [
"dotnet5.6",
"dnxcore50",
"portable-net45+win8"
]
}
},

"buildOptions": {
"emitEntryPoint": true,
"preserveCompilationContext": true
},

"runtimeOptions": {
"gcServer": true
},

"publishOptions": {
"include": [
"wwwroot",
"Views",
"appsettings.json",
"web.config"
]
},

"scripts": {
"postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
}
}

Nuget 包管理器的输出:

Package Microsoft.AspNetCore.Mvc 1.0.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package Microsoft.AspNetCore.Mvc 1.0.0 supports: - net451 (.NETFramework,Version=v4.5.1) - netstandard1.6 (.NETStandard,Version=v1.6)

最佳答案

您是否记得安装:.NET Core Tools for Visual Studio?你可以得到那个 here .

看看 Scott Hanselman 的 Blog .

关于asp.net-core - 依赖 microsoft.aspnetcore.mvc 1.0.0 不支持框架 .NETCoreApp,Version=v1.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38088295/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com