gpt4 book ai didi

asp.net-core - 带有 MVC iapplicationbuilder 的 ASP.NET Core 不包含 usemvc 的定义

转载 作者:行者123 更新时间:2023-12-04 03:18:02 26 4
gpt4 key购买 nike

在 VS Code 中构建 .net core mvc 应用程序并收到错误 IApplicationBuilder does not contain a definition for UseMvc。这是我的 project.json 中的依赖项:

"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.1",
"type": "platform"
},
"Microsoft.AspNetCore.Diagnostics": "1.0.0",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
"Microsoft.Extensions.Logging.Console": "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.Configuration.CommandLine": "1.0.0",
"Microsoft.Extensions.DependencyInjection": "1.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0",
"Microsoft.AspNetCore.StaticFiles": "1.0.0"

最佳答案

看起来像一个愚蠢的依赖。尝试改变这个:

"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",

为此:

"Microsoft.AspNetCore.Mvc": "1.0.1",

关于asp.net-core - 带有 MVC iapplicationbuilder 的 ASP.NET Core 不包含 usemvc 的定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39865376/

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