在Docker容器

时间:2015-09-11 12:00:46

标签: 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

1 个答案:

答案 0 :(得分:0)

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

确保所有project.json中只引用了一个流,解决了这个问题。