1. 程式人生 > >.NET Core 2.1 and AWS

.NET Core 2.1 and AWS

We’re excited about the recently released .NET Core 2.1, and we’re sure many of our AWS .NET developers are also eager to get started with .NET Core 2.1. Look forward to future announcements from us as we get our AWS services, such as AWS Elastic Beanstalk, AWS Lambda, and AWS CodeBuild, updated for .NET Core 2.1.

Getting Started Today

While we get our AWS services updated for .NET Core 2.1, you can use .NET Core 2.1 today on most AWS services with just a couple more steps.

Using .NET Core 2.1 with Containers

The .NET Team at Microsoft has published new docker base images for .NET Core 2.1 (

https://hub.docker.com/r/microsoft/dotnet/). You can use these in any of the AWS container-based services. For AWS CodeBuild, use one of the images with “sdk” in the tag name. These images contain all of the necessary tools to build your .NET Core application.

You can execute your .NET Core application on

Amazon Elastic Container Service (Amazon ECS). When building your docker image for Amazon ECS, choose images with “runtime” in the tag name to create smaller container images. If you are deploying an ASP.NET Core application then choose an image with “aspnetcore-runtime” in the tag name which will include the ASP.NET Core framework. These runtime images enable you to improve startup time and can allow you to run a denser cluster with smaller images. If you’ve never deployed a .NET Core container application to AWS, our AWS Guide for .NET Developers can help you get started.

Deploying ASP.NET Core 2.1 Applications with AWS Elastic Beanstalk

One of the great strengths of the .NET Core platform is its ability to publish as a self-contained application. This means that although the Elastic Beanstalk environments aren’t updated yet with .NET Core 2.1, we can direct the .NET Core publish mechanism to do a self-contained publish and the .NET Core 2.1 runtime will be included with the publish bundle.

To turn on the self-contained publish mode for an ASP.NET Core project, you need to edit your .csproj file and add a property that sets the RuntimeIdentifier to win-x64. Setting it to win-x64 tells the dotnet publish command, which the AWS Toolkit for Visual Studio uses, to include the 64-bit Windows .NET Core runtime.


<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp2.1</TargetFramework>
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>

  <ItemGroup>
    <DotNetCliToolReference Include="Amazon.ElasticBeanstalk.Tools" Version="1.1.3" />
  </ItemGroup>
</Project>

In the .csproj file above, notice a DotNetCliToolReference to Amazon.ElasticBeanstalk.Tools. This is a dotnet CLI extension we created, similar to our AWS Lambda extension, that enables you to perform your Elastic Beanstalk deployments from the dotnet CLI. In version 1.1.4, there’s a new –publish-options switch that enables you to pass parameters to the underlying call to dotnet publish. By using this, you can do a self-contained publish without even modifying your .csproj file. Here is an example of initiating a self-contained deployment.

dotnet eb deploy-environment --publish-options "--runtime win-x64"

For more information about this and about AWS Lambda and Amazon ECS dotnet CLI extensions, check out the GitHub repository.

Stay Connected

We’ll have more announcements as we get AWS services updated to .NET Core 2.1. Be sure to follow our AWS Developer Blog for .NET and our AWS SDK for .NET Twitter handle (@awsfornet) for the latest news coming from our team.

相關推薦

.NET Core 2.1 and AWS

We’re excited about the recently released .NET Core 2.1, and we’re sure many of our AWS .NET developers are also eager to get started with .NET Co

[搬運] .NET Core 2.1中改進的堆棧信息

我們 previous http mon 告訴 以及 async 時間 異步 原文 : Stacktrace improvements in .NET Core 2.1 作者 : Ben Adams 譯者 : 張很水 . NET Core 2.1 現在具有可讀的異步堆棧

.net core 2.1 以上SignalR實現

focus rev cep 中心 mov 使用 CA rtu self 本教程教生成實時應用程序使用 ASP.NET Core SignalR 的基礎知識。 SignalR在.net core2.1以前是需要下載 Microsoft.AspNetCore.S

.NET Core 2.1來了!

and 圖片 ++ 切換 href 5.7 AS 同事 編譯型 太棒了! .NET Core 2.0正式發布至今已經過去了大半年,這大半年說長不長說短不短,這段時間裏,我是充分地體會到了微軟的誠意,那就是認認真真打造一個優秀的開源平臺。這大半年的時間裏,微軟一直在為.NE

用ASP.NET Core 2.1 建立規範的 REST API -- HATEOAS

enume edi count DC tutorial 不知道 客戶 自適應 獨立 本文所需的一些預備知識可以看這裏: http://www.cnblogs.com/cgzl/p/9010978.html 和 http://www.cnblogs.com/cgzl/p/90

學習 ASP.NET Core 2.1:集成測試中使用 WebApplicationFactory

UNC enc sta 測試 修改 構造 creat -a msdn WebApplicationFactory 是 ASP.NET Core 2.1 新特性 MVC functional test infrastructure 中帶來的新東東,它封裝了 TestServe

asp.net core 2.1 將控制器抽離到類庫中

cat start service public 網站 類庫 class all app startup.cs的ConfigureServices中添加: public void ConfigureServices(IServiceCollection

樹莓派安裝.net core 2.1

http nbsp 內容 oca mkdir -p 安裝 參考 tro tps 0.更新源 sudo apt-get update 1.安裝依賴 sudo apt-get install curl libunwind8 gettext 2.下載 SDK 或者 RunTi

將 ASP.NET Core 2.0 項目升級至 ASP.NET Core 2.1.3X

微信公眾號 code ima microsoft 訪問 nload 操作 更新 解決辦法 在上一篇文章ASP.Net Core 運行錯誤 Http Error 502.5 解決辦法的最後有提到說,最推薦的升級辦法是從2.0升級到2.1X版本. 操作如下 項目的例子直接使用h

.net Core 2.1 MVC+EF+Redis搭建

文件 dds cookie exception reg direct mvc+ef microsoft encoding 官方學習資料 搭建空MVC框架 1.創建一個空模板 2.創建文件夾 Controllers、Models、Views 3.在Contro

再談使用X.PagedList.Mvc 分頁(ASP.NET Core 2.1

asp ram 默認 mvc 文本 它的 otn package www. 在以前的博文中寫過使用X.PagedList.Mvc組件來對ASP.NET MVC應用程序進行分頁,可以參考此篇隨筆:Asp.net MVC 使用PagedList(新的已更名 為X.PagedLi

ASP.NET core 2.1部署到 Centos 7

-m lrzsz arc -perm 安裝asp.net local ESS port pub 步驟要點: 一、關閉Linuxselinux: 操作方式: 1.永久關閉:打開/etc/selinux/config文件,設置SELINUX=disabled,註意,不是S

Asp.net Core 2.1使用 EF Core 簡單增刪改查操作數據庫

generic nuget ini gen 項目 pub sass .net 增刪改查 Asp.net Core 2.1使用 EF Core 簡單增刪改查操作數據庫 大概步驟如下5步: 1、創建項目(Asp.net Core 2.1項目) 2、項目使用EF Core 3、建

獨立部署asp.net core 2.1 Web應用程式

1.建立asp.net core 2.0  Web應用程式 新增引用: Microsoft.EntityFrameworkCore.Sqlite Microsoft.EntityFrameworkCore.Sqlite.Design 2.配置Sqlite資料庫 修改Startup.cs檔案

獨立部署asp.net core 2.1 Web應用程序

ring tar sign options \n rgs migration 局域網 引用 1.創建asp.net core 2.0 Web應用程序 添加引用: Microsoft.EntityFrameworkCore.Sqlite Microsoft.EntityFr

從零開始學習 asp.net core 2.1 web api 後端api基礎框架(七)-新增一個查詢單筆資料的方法

再寫一個查詢單筆資料的方法: [Route("{id}")] public JsonResult GetProduct(int id) { return new JsonResult(ProductService.Curre

從零開始學習 asp.net core 2.1 web api 後端api基礎框架(六)-把獲取資料的程式碼整理成一個服務

建立一個Services目錄, 然後建立一個 ProductService.cs類 我們把獲取資料的程式碼整理成一個ProductService, 然後保證程式執行的時候, 操作的是同一批資料: namespace CoreBackend.Api.Services { public

從零開始學習 asp.net core 2.1 web api 後端api基礎框架(五)-Routing 路由

路由有兩種方式: Convention-based (按約定), attribute-based(基於路由屬性配置的).  其中convention-based (基於約定的) 主要用於MVC (返回View或者Razor Page那種的). Web api 推薦使用attribute

Asp.net Core 2.1 Kestrel 現在支援 多協議處理(Tcp)

地址:https://github.com/davidfowl/MultiProtocolAspNetCore.git 在一個Kestrel服務上可以同時處理Tcp,Http,Https等多種協議。 通過實現 ConnectionHandler 處理接入連線,ConnectionContext.Trans

Net Core 2.1 HttpClient範例

Net Core 2.1 HttpClient請求幫助類 1、需要引用Newtonsoft.Json的nuget包,目前版本為11.0.2 2、添加了一些認證資訊的寫法 using Newtonsoft.Json; using System; using System.Collect