Publish Project to AWS
From MgmtWiki
Full Title or Meme
Build and zip a Visual Studio dot net core 2.1+ Project for publication to Amazon Web Services.
Context
Problems
Solution
From the website Deploying an ASP.NET core application with Elastic Beanstalk.
- Prepare a project with all dependencies marked.
- Add a deployment file (see section below)
- from powershell type "dotnet publish" (this and future commands are typed in the project directory)
Deployment File
- From the website Running multiple applications and ASP.NET core applications with a deployment manifest
- name file aws-windows-deployment-manifest.json in the project directory with "Build Action" : "Content" and "Copy to Output Directory" : "Copy always"
- Bundle the manifest and site archive in a ZIP archive to create a source bundle.
{ "manifestVersion": 1, "deployments": { "aspNetCoreWeb": [ { "name": "my-dotnet-core-app", "parameters": { "archive": "dotnet-core-app.zip" } } ] } }
Example dotnet-core-bundle.zip -- aws-windows-deployment-manifest.json -- dotnet-core-app.zip
PS C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer> dotnet publish Microsoft (R) Build Engine version 16.6.0+5ff7b0c9e for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Determining projects to restore... All projects are up-to-date for restore. SimpleService -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\SimpleService\bin\Debug\netcoreapp3.1\SimpleService.dll CredStore -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\CredStore\bin\Debug\netcoreapp3.1\CredStore.dll MonitorService -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\MonitorService\bin\Debug\netcoreapp3.1\MonitorService.dll RegistryServer -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer\bin\Debug\netcoreapp3.1\RegistryServer.dll RegistryServer -> C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer\bin\Debug\netcoreapp3.1\publish\ PS C:\Users\rp_to_000\Documents\TopCat\Repos\TrustRegistry3\RegistryServer>