Closed Shockolate closed 6 years ago
Is this a Web API project created before updating Visual Studio to the latest toolkit? Can you share the csproj file?
The original solution was a Web API Project (with Tests) that was created with the blueprint from the previous VS Toolkit. When the latest version was released, I downloaded & installed it, and created a parallel project with the same Blueprint.
I then made changes to the original solution:
Thanks for your attention, @normj
My .csproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Amazon.Lambda.AspNetCoreServer" Version="2.0.0" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.3.4" />
<PackageReference Include="Microsoft.AspNetCore.All" Version="2.0.3" />
</ItemGroup>
<ItemGroup>
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.1" />
<DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="2.0.1" />
</ItemGroup>
</Project>
Ah I forgot in the .NET Core 1.0 project template I set the Sdk at the root to Microsoft.NET.Sdk. I did that to prevent the refs folder being generated in the package bundle. Probably wasn't my best idea :)
Can you update
<Project Sdk="Microsoft.NET.Sdk">
to
<Project Sdk="Microsoft.NET.Sdk.Web">
I'm finishing up my blog post on Serverless ASP.NET Core, I'll add a note about this migration detail.
That did the trick! Thanks, @normj
Hello, As outlined in the re:Invent video, it is my understanding that the lambda compute substrate has the AspNetCore package stored locally. The demo shows a small deployment package with no AspNetCore dependencies.
However, when using the latest tools version for .NET Core 2.0 support, I notice that the AspNetCore dependencies are being packaged, causing a package 10x the size in the video. Is this a bug, or a feature yet to be released?
It is crucial to minimize deployment package size to minimize cold-start time.
EDIT: I am using the exact same NuGet packages and versions as defined in the WebAPI Blueprint.
EDIT2: How I'm calling those CLI tools. Excuse the Ruby-isms: Package:
Deployment