在Visual Studio 2017中使用AWS Toolkit使用.Net Core 2部署到Beanstalk

时间:2017-09-27 10:23:00

标签: amazon-web-services asp.net-core visual-studio-2017 elastic-beanstalk

尝试使用Visual Studio 2017 AWS Toolkit扩展将基本的“开箱即用”.Net Core 2 Web Api部署到AWS Beanstalk,但无法部署。

下面是尝试部署的示例日志,因为您可以看到它好像没有正确打包它进行打包。尝试过使用清单文件,但它没有任何区别。对于记录.Net Core 1.1部署得很好。

26/09/2017 01:04:10         terminateEnvironment completed successfully.
26/09/2017 01:04:09         Deleting SNS topic for environment blueostrichdesign-test.
26/09/2017 01:04:07         Deleted EIP: 52.56.251.100
26/09/2017 01:03:52         Deleted security group named: sg-84fbe6ed
26/09/2017 01:03:11         Removed instance 'i-0e10ac9a19db43b5b' from your environment.  (Reason: Instance is in 'terminated' state)
26/09/2017 01:02:05         Waiting for EC2 instances to terminate. This may take a few minutes.
26/09/2017 01:01:49         terminateEnvironment is starting.
26/09/2017 00:59:01         Create environment operation is complete, but with errors. For more information, see troubleshooting documentation.
26/09/2017 00:58:02         Environment health has been set to GREEN
26/09/2017 00:57:58         Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
26/09/2017 00:57:58         [Instance: i-0e10ac9a19db43b5b ConfigSet: Infra-EmbeddedPreBuild, Hook-PreAppDeploy, Infra-EmbeddedPostBuild, Hook-EnactAppDeploy, Hook-PostAppDeploy, Hook-PostInit, Infra-WriteVersionOnStartup] Command failed on instance. Return code: 1 Output: null.
26/09/2017 00:57:56         Error occurred during build: Command hooks failed
26/09/2017 00:57:53         Error during deployment: Could not find a part of the path 'C:\\inetpub\\AspNetCoreWebApps\\app\\appsettings.Development.json'.
26/09/2017 00:56:52         Added EC2 instance 'i-0e10ac9a19db43b5b' to Auto Scaling Group 'awseb-e-kezahpkrmy-stack-AWSEBAutoScalingGroup-DJU0DMK4CG3B'.
26/09/2017 00:56:52         Adding instance 'i-0e10ac9a19db43b5b' to your environment.
26/09/2017 00:56:08         Waiting for EC2 instances to launch. This may take a few minutes.
26/09/2017 00:55:19         Created EIP: 52.56.251.100
26/09/2017 00:55:03         Created security group named: sg-84fbe6ed
26/09/2017 00:54:44         Using elasticbeanstalk-eu-west-2-292368120263 as Amazon S3 storage bucket for environment data.
26/09/2017 00:54:43         createEnvironment is starting.

有没有其他人打过这个,如果有的话,他们怎么会绕过它。在网络上找不到任何其他帮助或我应该做的事情。

我还没有探索Docker的可能性,但我的理解是这应该是开箱即用的。

1 个答案:

答案 0 :(得分:2)

因此,经过大量挖掘而不是AWS支持的大量帮助后,我发现这是WebApi的一个问题,这要归功于另一个问题的另一个答案。大量的试验和错误导致发现,如果您将wwwroot文件夹添加到项目中并确保它应对输出或在其中包含占位符文件,它应该部署得很好!