Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-mvc/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASP.Net应用程序中使用MVC6的依赖项冲突_C#_Asp.net Mvc_Dependencies_Entity Framework 6 - Fatal编程技术网

C# ASP.Net应用程序中使用MVC6的依赖项冲突

C# ASP.Net应用程序中使用MVC6的依赖项冲突,c#,asp.net-mvc,dependencies,entity-framework-6,C#,Asp.net Mvc,Dependencies,Entity Framework 6,这可能是依赖冲突吗?我犯了一个错误。我已尝试更改依赖项,但它仍会返回这些错误,我需要您的支持。 这是project.json文件 "dependencies": { "Microsoft.AspNet.Server.IIS": "1.0.0-beta5", "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5", "Microsoft.AspNet.Mvc": "6.0.0-beta5", "EntityFrame

这可能是依赖冲突吗?我犯了一个错误。我已尝试更改依赖项,但它仍会返回这些错误,我需要您的支持。 这是project.json文件

"dependencies": {
    "Microsoft.AspNet.Server.IIS": "1.0.0-beta5",
    "Microsoft.AspNet.Server.WebListener": "1.0.0-beta5",
    "Microsoft.AspNet.Mvc": "6.0.0-beta5",
    "EntityFramework.SqlServer": "7.0.0-beta5",
    "EntityFramework.Commands": "7.0.0-beta5",
    "Microsoft.Framework.Configuration.Json": "1.0.0-beta8"
  },
这是StartUp.cs文件:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.Framework.DependencyInjection;

using MyQuotesApps.models;
using Microsoft.Framework.Runtime;
using Microsoft.Framework.Configuration;
using Microsoft.AspNet.Hosting;

namespace MyQuotesApps
{
    public class Startup
    {
        public IConfiguration Configuration { get; set; }
        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
            services.AddEntityFramework().AddSqlServer()
                .AddDbContext<QuotesAppContext>(options =>options.UseSqlServer(Configuration["Data:ConnectionString"]));
        }

        public Startup(IHostingEnvironment env, IApplicationEnvironment appenv) {
            var configurationBuilder = new ConfigurationBuilder(appenv.ApplicationBasePath);
            configurationBuilder.AddJsonFile("config.json");
            configurationBuilder.AddEnvironmentVariables();
            Configuration = configurationBuilder.Build();
        }

        public void Configure(IApplicationBuilder app)
        {
            app.UseMvc();
        }
    }
}

您必须迁移到ASP.net Core 1.0。如果您仍然使用测试版软件包,您将遇到很大的麻烦。因此,请开始迁移或使用最新的软件包创建新项目

在这里,您可以看到如何迁移:

或者从最新的.Net核心开始:


您必须迁移到ASP.net Core 1.0。如果您仍在使用测试版软件包,您将遇到很大的麻烦。因此,请开始迁移或使用最新软件包创建新项目

在这里,您可以看到如何迁移:

或者从最新的.Net核心开始:


您能分享一下如何操作吗?我不是一个.Net的人。通过添加代码片段进行详细说明。您的问题与您的代码无关。这是您的框架上的问题。因此,您必须将其升级到更稳定和最新的版本。因此,您是.net新手,我建议您使用最新的框架启动一个新项目。请按照我在上面的帖子中添加的链接(即开始使用ASP.NET核心MVC和Visual Studio)进行操作。你能分享一下如何操作吗?我不是一个.Net的人。通过添加代码片段进行详细说明。您的问题与您的代码无关。这是您的框架上的问题。因此,您必须将其升级到更稳定和最新的版本。因此,您是.net新手,我建议您使用最新的框架启动一个新项目。请遵循我在上面的帖子中添加的链接(即开始使用ASP.NET核心MVC和Visual Studio)。
Severity    Code    Description Project File    Line    Suppression State
Error   CS1503  Argument 1: cannot convert from 'string' to 'Microsoft.Framework.Configuration.IConfigurationProvider'  MyQuotesApps.DNX 4.5.1, MyQuotesApps.DNX Core 5.0   C:\Users\ken4ward\documents\visual studio 2015\Projects\MyQuotesApps\src\MyQuotesApps\Startup.cs    28  Active
Error   CS1061  'EntityOptionsBuilder' does not contain a definition for 'UseSqlServer' and no extension method 'UseSqlServer' accepting a first argument of type 'EntityOptionsBuilder' could be found (are you missing a using directive or an assembly reference?)   MyQuotesApps.DNX 4.5.1, MyQuotesApps.DNX Core 5.0   C:\Users\ken4ward\documents\visual studio 2015\Projects\MyQuotesApps\src\MyQuotesApps\Startup.cs    24  Active