Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.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
Asp.net core 部署ASP.NET Core 1.1.0和;实体框架核心1.1:无法加载程序集system.Collections.Immutable,版本=1.1.37.0_Asp.net Core_Entity Framework Core_Asp.net Core 1.1 - Fatal编程技术网

Asp.net core 部署ASP.NET Core 1.1.0和;实体框架核心1.1:无法加载程序集system.Collections.Immutable,版本=1.1.37.0

Asp.net core 部署ASP.NET Core 1.1.0和;实体框架核心1.1:无法加载程序集system.Collections.Immutable,版本=1.1.37.0,asp.net-core,entity-framework-core,asp.net-core-1.1,Asp.net Core,Entity Framework Core,Asp.net Core 1.1,我将我的项目迁移到ASP.NETCore1.1.0和EntityFrameworkCore1.1,开发过程中一切正常 但无法在暂存中部署项目,我从标准输出日志中发现以下错误: 应用程序启动异常:System.IO.FileLoadException:不可能 总成上的充电器 'Microsoft.Extensions.DependencyInjection.Abstractions, 版本=1.0.0.0,区域性=中性,PublicKeyToken=adb9793829ddae60'ou 不适用于

我将我的项目迁移到ASP.NETCore1.1.0和EntityFrameworkCore1.1,开发过程中一切正常

但无法在暂存中部署项目,我从标准输出日志中发现以下错误:

应用程序启动异常:System.IO.FileLoadException:不可能 总成上的充电器 'Microsoft.Extensions.DependencyInjection.Abstractions, 版本=1.0.0.0,区域性=中性,PublicKeyToken=adb9793829ddae60'ou 不适用于待决事项。明显的惩罚 总成不符合总成的要求。(例外情况 de HRESULT:0x8013100)菲舍尔名称: 'Microsoft.Extensions.DependencyInjection.Abstractions, 版本=1.0.0.0,区域性=中性,PublicKeyToken=adb9793829ddae60'
…Agata.Presentation.Web.Startup.ConfigureServices(IServiceCollection (服务) ---桩身痕迹的尾翼……安放位置的第三部分——特殊情况… System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()… Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection 服务)… Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() …Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

我检查了解决方案中包含的所有项目的所有nuget包,并且所有依赖项都是最新的

我已经删除了staging的所有目录,并完全重新部署它,以确保没有旧的DLL,但错误仍然存在。 我还多次重启IIS池和网站

服务器上安装了.NET Core 1.1.0

有人知道这里发生了什么吗

编辑:这是我的project.json:

 "dependencies": {
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview3-final",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview3-final",
    "Npgsql": "3.1.6",
    "Remotion.Linq": "2.1.1",
    "Serilog.Sinks.RollingFile": "3.2.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.Extensions.Configuration.Binder": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Serilog.Extensions.Logging": "1.3.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "System.Interactive.Async": "3.1.0",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
  },

  "tools": {
    "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
  },
 "dependencies": {
    "Npgsql": "3.1.6",
    "Remotion.Linq": "2.1.1",
    "Serilog.Sinks.RollingFile": "3.2.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.Extensions.Configuration.Binder": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Serilog.Extensions.Logging": "1.3.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
    "System.Interactive.Async": "3.1.0"
  },

  "tools": {
    "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
  },
编辑:问题现在不同了,错误现在是:

应用程序启动异常:System.IO.FileLoadException: 不可能从装配中卸下充电器 'System.Interactive.Async,版本=3.0.0.0,区域性=中性, PublicKeyToken=94bc3704cddfc263“您必须支付”待付款。洛杉矶 d.大会的最终结果 装配法。(HRESULT异常:0x8013100) Nom de fichierÿ:“System.Interactive.Async,Version=3.0.0.0,Culture=neutral,PublicKeyToken=94bc3704cddfc263” …Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddQuery(IServiceCollection 服务收集) …Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServiceCollectionExtensions.AddEntityFramework(IServiceCollection 服务收集) …Microsoft.EntityFrameworkCore.Infrastructure.RelationalServiceCollectionExtensions.AddRelational(IServiceCollection (服务) …Microsoft.Extensions.DependencyInjection.SqlServerServiceCollectionExtensions.AddEntityFrameworkSqlServer(IServiceCollection (服务) …Agata.Presentation.Web.Startup.ConfigureServices(IServiceCollection 服务)丹麦 C:\Workspace\performancesetcontrols\Agata\DevLot1\Presentation\Agata.Presentation.Web\Startup.cs:ligne 65 ---桩身痕迹的尾翼……安放位置的第三部分,凹痕和凹痕,例外情况a,t,lev,e--- …System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() …Microsoft.AspNetCore.Hosting.ConventionBasedStartup.ConfigureServices(IServiceCollection (服务) …Microsoft.AspNetCore.Hosting.Internal.WebHost.EnsureApplicationServices() …Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()

这是我更新的project.json:

 "dependencies": {
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.2",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview3-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.0.0-preview3-final",
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": "1.0.0-preview3-final",
    "Npgsql": "3.1.6",
    "Remotion.Linq": "2.1.1",
    "Serilog.Sinks.RollingFile": "3.2.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.Extensions.Configuration.Binder": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Serilog.Extensions.Logging": "1.3.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "System.Interactive.Async": "3.1.0",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final"
  },

  "tools": {
    "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
  },
 "dependencies": {
    "Npgsql": "3.1.6",
    "Remotion.Linq": "2.1.1",
    "Serilog.Sinks.RollingFile": "3.2.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
    "Microsoft.AspNetCore.StaticFiles": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": "1.1.0",
    "Microsoft.Extensions.Configuration.Binder": "1.1.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "1.1.0",
    "Microsoft.Extensions.Logging.Console": "1.1.0",
    "Microsoft.Extensions.Logging.Debug": "1.1.0",
    "Serilog.Extensions.Logging": "1.3.0",
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.0",
    "Microsoft.Extensions.Logging": "1.1.0",
    "Microsoft.EntityFrameworkCore": "1.1.0",
    "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0",
    "Microsoft.EntityFrameworkCore.Tools": "1.1.0-preview4-final",
    "System.Interactive.Async": "3.1.0"
  },

  "tools": {
    "Microsoft.Extensions.SecretManager.Tools": "1.1.0-preview4-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": "1.1.0-preview4-final"
  },
我的启动文件的第65行是:

services.AddEntityFrameworkSqlServer().AddDbContext<MyDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("MyDbConnectionString")));
services.AddEntityFrameworkSqlServer().AddDbContext(options=>options.UseSqlServer(Configuration.GetConnectionString(“MyDbConnectionString”));
它在visual studio的调试中仍然可以正常工作

编辑2:我解析了System.Interactive.Async更新Serilog.Extensions.Logging包的问题。。。我现在有一个错误:

System.IO.FileLoadException:不可能对le fichier ou进行充电 l'assembly'System.Collections.Immutable,版本=1.1.37.0, 区域性=中性,PublicKeyToken=b03f5f7f11d50a3a您不需要 依赖。大会宣言的定义 协调议会的议事规则。(HRESULT例外: 0x8013100)Nom de fichier:'System.Collections.Immutable, 版本=1.1.37.0,区域性=中性,PublicKeyToken=b03f5f7f11d50a3a'
à Microsoft.AspNetCore.Mvc.Razor.Internal.RazorReferenceManager..ctor(ApplicationPartManager 部件管理器,IOOptions`1选项访问器) ---在新发现的例外情况下,在新发现的侵位过程中,对桩体进行追踪---

我对这次部署简直是疯了


解决方案:部署包含一些类库依赖项绑定的web应用程序可执行文件的配置文件

解决方案是部署包含一些类库依赖项绑定的web应用程序可执行文件的配置文件。NET的一个老做法是永远不要部署.config文件,但这个做法显然需要与.NET Core一起检查

发布网站时,生成的包包含一些配置文件,其中一个与应用程序的可执行文件YourWebsiteNamespace.exe.config同名。此配置文件包含一些dll绑定,需要与应用程序一起部署

此文件可以包含的内容示例:

<configuration>
  <runtime>
    <gcServer enabled="true" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.1.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="1.1.37.0" newVersion="1.2.1.0" />
        <bindingRedirect oldVersion="1.2.0.0" newVersion="1.2.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="1.2.0.0" newVersion="1.4.1.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Xml.ReaderWriter" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.1.2.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="4.0.1.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>