Cannot build using mcr.microsoft.com/dotnet/sdk:6.0
See original GitHub issueDescribe the bug
Hello up until recently (3 days ago) I was able to run
dotnet lambda package --configuration Release
In Docker file.
Today I started having this error
Target Framework of netcoreapp6.0 must have output type 'exe' and run on a custom runtime, since this is not a Lambda-managed .NET runtime.
I had to force to use older version for SAM to be able to build the project
RUN dotnet tool install -g Amazon.Lambda.Tools --version 5.5.0
Expected Behavior
Build the project and push to clouformation
Current Behavior
Error
Target Framework of netcoreapp6.0 must have output type 'exe' and run on a custom runtime, since this is not a Lambda-managed .NET runtime.
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
Targeted .NET platform
.NET6
CLI extension version
5.6.0
Environment details (OS name and version, etc.)
Windows 10
Issue Analytics
- State:
- Created 10 months ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Microsoft SDK docker image can build but not run a web app
1 Answer. The solution is to have a multipart dockerfile where you build with the sdk and then run with a runtime different...
Read more >My solution is not building when I use docker image mcr ...
My solution is not building when I use docker image mcr.microsoft.com/dotnet/sdk:5.0 - Microsoft Q&A.
Read more >PublishReadyToRun fails on .NET6 / linux-musl-x64 / Docker
I'm trying to build using PublishReadyToRun with net6.0 in Docker ... FROM mcr.microsoft.com/dotnet/sdk:6.0-alpine AS build COPY .
Read more >Why isn't my ASP.NET Core app in Docker working?
In this post I describe a problem where my ASP.NET Core app in Docker wasn't responding to requests. This post debugs and diagnoses...
Read more >Build your .NET image
Learn how to build your first Docker image by writing a Dockerfile. ... syntax=docker/dockerfile:1 FROM mcr.microsoft.com/dotnet/sdk:6.0 as build-env.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@normj Thank you for the clarifications.
If I remember correctly i ended up using netcore6.0 because .net 6 was not supported back then or i had some issues. Don’t remember exactly.
There is no problem to switch to .net6.
thank you both for your time.
⚠️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.