Trying to use AWS Toolkit to publish Lambda functions using VS 2022 and C#. Builds OK, but publish throws this error. Current TragetFramework is set to net6.0. I tried deleting obj and bin folders, but no help. I do have VS 2019 installed on the same machine and not sure if that is interfering in any way. NuGet Manager version is 6.2.0
error NETSDK1005: Assets file doesn't have a target for 'netcoreapp3.1'. Ensure that restore has run and that you have included 'netcoreapp3.1' in the TargetFrameworks for your project
In my case it was just a matter of deleting the publish profile and creating a new one.