aws-lambda-dotnet icon indicating copy to clipboard operation
aws-lambda-dotnet copied to clipboard

`dotnet new lambda/serverless.* ...` fails with .NET 7.0.100-rc.1.22431.12

Open bjhogan opened this issue 3 years ago • 3 comments

Describe the bug

With the .NET SDK 7.0.100-rc.1.22431.12, dotnet new lambda.EmptyFunction ... and other templates fail.

> dotnet new lambda.EmptyFunction -n MyEmptyFunction
Template "Lambda Empty Function" could not be created.
Failed to create template.
Details: Object reference not set to an instance of an object.

For details on the exit code, refer to https://aka.ms/templating-exit-codes#100
> dotnet new serverless.AspNetCoreWebApp -n AspNetCoreWebApp
Template "Lambda ASP.NET Core Web Application with Razor Pages" could not be created.
Failed to create template.
Details: Object reference not set to an instance of an object.

Expected Behavior

dotnet new lambda.EmptyFunction ... creates the appropriate projects.

Current Behavior

Command fails with -

Template "Lambda Empty Function" could not be created.
Failed to create template.
Details: Object reference not set to an instance of an object.

For details on the exit code, refer to https://aka.ms/templating-exit-codes#100

Reproduction Steps

Download .NET SDK 7.0.100-rc.1.22431.12

Run dotnet new lambda.EmptyFunction -n MyEmptyFunction

Possible Solution

Can workaround this problem by creating a global.json file for an earlier version of .NET.

dotnet new globaljson --sdk-version 6.0.401

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

.NET SDK 7.0.100-rc.1.22431.12

Amazon.Lambda.Templates (version 6.3.0) amazon.lambda.tools version 5.4.5

Targeted .NET Platform

.NET SDK 7.0.100-rc.1.22431.12

Operating System and version

Windows 10

bjhogan avatar Sep 22 '22 13:09 bjhogan

Hi @bjhogan,

Good morning.

.NET 7 is in RC1 and support for it needs to be added in AWS Tooling. I do not have any timelines are this stage, but this should be added eventually.

Thanks, Ashish

ashishdhingra avatar Sep 22 '22 16:09 ashishdhingra

Hi @ashishdhingra,

FYI, this used to work with an earlier version of .NET 7.

Bryan

bjhogan avatar Sep 22 '22 16:09 bjhogan

I opened up an issue against on the Microsoft templating repository to get some help debugging this issue. https://github.com/dotnet/templating/issues/5300

normj avatar Sep 23 '22 06:09 normj

Version 6.4.0 of the template has been released with the fix. Thanks for reporting the issue Bryan!

normj avatar Sep 29 '22 20:09 normj

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.

github-actions[bot] avatar Sep 29 '22 20:09 github-actions[bot]