相关疑难解决方法(0)

没有为"Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory"类型提供服务

我遇到了这个问题:没有注册"Microsoft.AspNetCore.Mvc.ViewFeatures.ITempDataDictionaryFactory"类型的服务.在asp.net核心1.0中,似乎当动作尝试渲染视图时我有异常.

我搜索了很多,但我没有找到解决方案,如果有人可以帮我弄清楚发生了什么,我怎么能解决它,我会很感激.

我的代码如下:

我的project.json文件

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"

    },
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
    "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
    "EntityFramework.Commands": "7.0.0-rc1-final"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

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

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

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

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

  "scripts": {
    "postpublish": [ "dotnet publish-iis …
Run Code Online (Sandbox Code Playgroud)

c# asp.net asp.net-mvc asp.net-core-1.0

29
推荐指数
4
解决办法
2万
查看次数

标签 统计

asp.net ×1

asp.net-core-1.0 ×1

asp.net-mvc ×1

c# ×1