none
Configuração AspNetCore + Entity Framework RRS feed

  • Pergunta

  • Bom dia Pessoal!

    Estou desenvolvendo um formulário utilizando AspNetCore com acesso a dados pelo Entity Framework. Porém ao tentar rodar a aplicação ocorre a seguinte exceção:

    aspnetcore Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.

    Abaixo segue o meu Project.Json:

     "dependencies": {
        "Microsoft.NETCore.App": {
          "version": "1.0.1",
          "type": "platform",
          "Microsoft.Framework.Configuration.Json": "1.0.0-*"
        },
        //"Microsoft.AspNetCore.Diagnostics": "1.0.0",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.0.1",
        "Microsoft.Extensions.Logging.Console": "1.0.0",
        //"Newtonsoft.Json": "9.0.1",
        "Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-*",
        "Microsoft.Extensions.Configuration.Json": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.StaticFiles": "1.0.0-rc2-final",
        //"Microsoft.AspNetCore.Mvc": "1.0.0-rc2-final",
        "Microsoft.AspNetCore.Mvc.Abstractions": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Formatters.Json": "1.1.3",
        "Microsoft.AspNetCore.Mvc.ApiExplorer": "1.1.3",
        "Microsoft.AspNetCore.Mvc.DataAnnotations": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Core": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Razor": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Razor.Host": "1.1.3",
        "Microsoft.AspNetCore.Mvc.TagHelpers": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Cors": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Localization": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Formatters.Xml": "1.1.3",
        "Microsoft.AspNetCore.Mvc.WebApiCompatShim": "1.1.3",
        "Microsoft.AspNetCore.Mvc.Versioning": "1.0.3",
        "Microsoft.AspNetCore.MvcFactory": "1.0.5",
        "Microsoft.AspNetCore.Mvc.ViewFeatures": "1.1.3",
        "EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
        "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.0.0",
        "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.0.0",
        "Microsoft.EntityFrameworkCore.Tools": "2.0.0-preview1-final",
        "Microsoft.EntityFrameworkCore.SqlServer": "2.0.0-preview1-final",
        "Microsoft.Extensions.DependencyInjection": "2.0.0-preview1-final",
        "Microsoft.EntityFrameworkCore.Relational": "2.0.0-preview1-final",
        "Microsoft.EntityFrameworkCore":  "2.0.0-preview1-final"
        //"EntityFramework.Commands": "7.0.0-beta2"
      },
      "commands": {
        "web": "Microsoft.AspnetCore.Server.Kestrel",
        "ef": "Microsoft.EntityFrameworkCore.Tools"
      },
      "tools": {
        "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
      },
      "frameworks": {
        "netcoreapp1.0": {
          "imports": [
            "dotnet5.6",
            "portable-net45+win8"
          ]
        }
      },
      "buildOptions": {
        "emitEntryPoint": true,
        "preserveCompilationContext": true,
        "copyToOutput": "appsettings.json"
      },
      "runtimeOptions": {
        "configProperties": {
          "System.GC.Server": true
        }
      },
      "publishOptions": {
        "include": [
          "wwwroot",
          "web.config",
          "config.json"
        ]
      },
      "scripts": {
        "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
      }
    }

    domingo, 21 de maio de 2017 23:30