0

I have developed a lambda serverless project with .Net core API and trying to deploy the package using dotnet lambda deploy-serverless

project: AWS lambda serverless .Net core API target framework: 2.1 error shown in dotnet deploy-servreless

I have read this article and many similar topics, about roslyn but doing these tasks didn't solve my issue.

Update: The API project builds with no warnings and even runs with visual studio, calling endpoints don't have any bugs even. The problem occurs deploying with powershell / dotnet lambda command

PM> Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform
PM> Uninstall-package Microsoft.Net.Compilers

But following the answers didn't solve my problem. I hadn't these packages in my solution and even installing them resulted in conflict warning, with .net core. I don't think my case is about roslyn.

Homa
  • 134
  • 1
  • 6

1 Answers1

0

I found a related thread on AWS Github: dotnet lambda package' failure after framework changing But it's closed without answer.

To spot the issues's context and scope, I tried these tests and relative results:

Error: Deploying the serverless lambda .net core API breaks. (and changing default targetframework from 1.0 to 2.1)

Tests: Deploying an external serverless lambda .net core API : works Deploying the simple lambda function clean template (with changing target framework) : works Deploying the serverless lambda .Net API clean template (without changing target framework) : works Deploying the serverless lambda .Net API clean template (with changing target framework) : breaks

Resolve: I created the project using dotnet cli command, it created with version 2.1 (latest in lambda) and packaging/deploying was successful. I guess a fresh install of VS 2017 having netcoreapp2.1 and higher should work fine.

Environment: I am using VS2017 , windows 10. first installed version of visual studio had .net core 1.0 and updated to 2.2 using VS update installer.

In fact there might be a bug with Visual studio update installer, some part with net core 1.0 is left behind the user's machine. (Currently every time I create a project it uses 1.0 and not the latest version possible, 2.2 and I should update it manually)

Homa
  • 134
  • 1
  • 6