简体   繁体   English

从Visual Studio 2015在Azure上发布到Docker时出错

[英]Error while publising to docker on Azure from Visual Studio 2015

I'm trying to publish my ASP.NET Core website on Azure Docker through visual studio 2015 using this Visual Studio extension. 我正在尝试使用 Visual Studio扩展通过Visual Studio 2015在Azure Docker上发布ASP.NET Core网站。 I have tried different approaches but failed to deploy in each one of them. 我尝试了不同的方法,但是未能在每种方法中都部署。

Approach 1 Created a windows docker container directly from Visual studio. 方法1直接从Visual Studio创建Windows docker容器。 In this case the VM was created successfully and I was to able validate the connection successfully before publish. 在这种情况下,VM已成功创建,我可以在发布之前成功验证连接。 在此处输入图片说明

However, the publish failed with following error 但是,发布失败并出现以下错误

Step 1 : FROM microsoft/aspnet:1.0.0-rc1-update1 Pulling repository
docker.io/microsoft/aspnet Error: image
microsoft/aspnet:1.0.0-rc1-update1 not found

Approach 2 Created a Linux docker container directly from Visual studio. 方法2直接从Visual Studio创建一个Linux docker容器。 Again, the VM was created successfully and I was able validate the connection successfully before publish. 同样,虚拟机创建成功,在发布之前,我能够成功验证连接。 On publishing I got following error: 发布时出现以下错误:

Executing command [docker --tlsverify -H tcp://vmname.southeastasia.cloudapp.azure.com:2376 logs cf32793c88939d664f67c651cbc75c4fb348fdd6fe85ea67322f9b5d049c0e70]
Failed to connect to http://vmname.southeastasia.cloudapp.azure.com/. If your Docker host is an Azure virtual machine, please make sure to set up the endpoint '80' using the Azure portal.
Container logs:
System.InvalidOperationException: The current runtime target framework is not compatible with 'MulitvideoMonitoring'.

Current runtime target framework: 'DNX,Version=v4.5.1 (dnx451)'

 Version:      1.0.0-rc1-16231
 Type:         Mono
 Architecture: x64
 OS Name:      Linux
 OS Version:   debian 7
 Runtime Id:   ubuntu.14.04-x64


Please make sure the runtime matches a framework specified in project.json
  at Microsoft.Dnx.ApplicationHost.DefaultHost.GetEntryPoint (System.String applicationName) [0x00000] in <filename unknown>:0 
  at Microsoft.Dnx.ApplicationHost.Program.ExecuteMain (Microsoft.Dnx.ApplicationHost.DefaultHost host, System.String applicationName, 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.String appBase, System.Runtime.Versioning.FrameworkName targetFramework) [0x00000] in <filename unknown>:0 

Approach 3 Created a classic VM from Azure portal with port 80 opened. 方法3从打开80端口的Azure门户创建经典VM。 On validating the connection it failed. 验证连接时失败。 While publishing it could not connect to the VM and gave following error: 发布时,它无法连接到VM,并出现以下错误:

Executing command [docker --tlsverify -H tcp://vmname.cloudapp.net:2376 ps -a | select-string -pattern ":80->" | foreach { Write-Output $_.ToString().split()[0] }]
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.DNX.Publishing.targets(386,5): 
Error : An error occurred trying to connect: Get https://vmname.cloudapp.net:2376/v1.22/containers/json?all=1: dial tcp 23.97.54.64:2376: 
connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Request your help to figure out the issue in the above three approaches. 请求您的帮助以找出以上三种方法中的问题。

I was able to resolve the issue on my Linux VM. 我可以在Linux VM上解决此问题。 The issue was due to the wrong runtime in dockerfile. 该问题是由于dockerfile中的运行时错误所致。 The auto-generated dockerfile from Visual Studio tooling had wrong runtime causing the issue. 从Visual Studio工具自动生成的dockerfile的运行时错误导致了问题。 The dockerfile had runtime FROM microsoft/aspnet:1.0.0-rc1-update1 changing it to microsoft/aspnet:1.0.0-rc1-update1-coreclr resolved the issue. dockerfile的运行时FROM microsoft/aspnet:1.0.0-rc1-update1更改为microsoft/aspnet:1.0.0-rc1-update1-coreclr解决了该问题。 I got the tip from an answer to similar question raised by me here . 我从这里提出的类似问题的答案中得到了提示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Visual Studio 2015发布时Azure工作者角色部署问题 - Azure worker role deployment issue while publishing from Visual studio 2015 在visual studio 2015社区安装Xamarin.Auth时出错 - Error while installing Xamarin.Auth on visual studio 2015 community 在Visual Studio 2015 Update 3中生成Windows 10构建时出错 - Error while Generating Windows 10 Build in Visual Studio 2015 Update 3 ASP.NET核心 - 在Visual Studio 2015中通​​过Docker进行调试时出现的问题 - ASP.NET Core - Issues while Debugging through Docker in Visual Studio 2015 Visual Studio 2015中的Azure Web作业 - 部署不使用错误“target”MSDeployPublish“项目中不存在”。 - Azure Web Job in Visual Studio 2015 - deploy not working with error “target ”MSDeployPublish“ does not exist in the project.” Visual Studio 2015:错误构建解决方案 - Visual Studio 2015: error building solution Visual Studio 2015 Update 1修复错误 - Visual Studio 2015 Update 1 repair error 在Visual Studio 2015中添加ConnectionString时出错 - Error in adding ConnectionString in Visual Studio 2015 请稍候 windows 正在配置 microsoft visual studio 2015 然后出现错误 2330 - please wait while windows configures microsoft visual studio 2015 then error 2330 从Visual Studio 2015在Azure中发布应用不会加载.CSS - Publishing app in Azure from Visual Studio 2015 doesn't load .CSS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM