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

我有一个运行Amazon Linux AMI 2015.03.1的t2.micro EC2实例。 我安装了泊坞窗 ,但也手动更新 。 最后,我让docker守护进程在我select的一个端口上监听,这样我就可以远程发布它。

在我的开发机器上,我添加了VS2015安装VS2015 Tools for Docker – August Preview 。 我添加了一个新的ASP.NET 5 Web应用程序,构build它并点击发布。 容器将其传递给主机,但由于此exception而永远不会运行;

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中只引用了一个stream,解决了这个问题。