amazon-ec2 - 在Docker容器中将ASP.NET 5应用程序部署到EC2

标签 amazon-ec2 docker asp.net-core

我有一个运行Amazon Linux AMI 2015.03.1。的t2.micro EC2实例。我在上面installed docker,然后手动updated it。最后,我使docker守护程序在我选择的端口上侦听,以便可以远程发布到它。

在我的开发机器上,我在VS2015中添加了VS2015 Tools for Docker - August Preview。我添加了一个新的ASP.NET 5 Web应用程序,对其进行了构建并点击了发布。容器将其发送到主机,但由于此异常它从未运行;

System.TypeLoadException: Could not load type 'Microsoft.Framework.Configuration.IConfigurationRoot' from assembly 'Microsoft.Framework.Configuration.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.
  at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain (Microsoft.Dnx.Runtime.DefaultHost host, System.String applicationName, System.String[] args) [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.ApplicationHost.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.Runtime.Common.EntryPointExecutor.Execute (System.Reflection.Assembly assembly, System.String[] args, IServiceProvider serviceProvider) [0x00000] in <filename unknown>:0
  at Microsoft.Dnx.Host.Bootstrapper.RunAsync (System.Collections.Generic.List`1 args, IRuntimeEnvironment env, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0

最佳答案

这是一个问题,因为有多个项目引用了不同版本的ASP.NET5- beta7和beta6。

确保在所有project.json中仅引用一个流即可解决此问题。

关于amazon-ec2 - 在Docker容器中将ASP.NET 5应用程序部署到EC2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32523045/

相关文章:

amazon-ec2 - 如何使用 esper 进行横向扩展?

amazon-web-services - 是否可以在AWS上创建小于原始大小的快照?无可启动设备错误或 Grub 错误 15

Docker 多阶段 : How to split up into multiple Dockerfiles

github - 引用存储在文本中的环境变量

asp.net-core - 如何在服务器端 Blazor 中通过 HttpContext 注销

amazon-web-services - 亚马逊 ec2 端口 443 未打开

ssh - 亚马逊 ec2 ssh 权限被拒绝(公钥)

java - 为什么 Java 11 基础 Docker 镜像如此之大? (openjdk :11-jre-slim)

c# - 如何使用 async Task<IActionResult> ?或者如何在我的 Asp.Net Core Web Api 中以异步方式运行

c# - ASP.NET Core 中基于 token 的身份验证