Add dotnetcore 2.1 support for init command - #665
Conversation
|
If you're making dotnetcore 2.1 the default then I think you also need to change the version in the aws-lambda-tools-defaults.json file in the src/HelloWorld folder. |
|
Good catch!! Didn’t know about that.
Will make that change tomorrow
…On Thu, 13 Sep 2018 at 20:56, gitsno ***@***.***> wrote:
If you're making dotnetcore 2.1 the default then I think you also need to
change the version in the aws-lambda-tools-defaults.json file in the
src/HelloWorld folder.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#665 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADL4BFJ3qW8fcp_tKeMod7VOwor65qhnks5uarhdgaJpZM4Wm6vZ>
.
|
|
@gitsno Change made and I also found another file that needed changing so Visual Studio would pick up the changes too (not only SAM). Followed guidelines here: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1 Installed latest Visual Studio and it recognized the latest and the target framework to 2.1 too. |
jfuss
left a comment
There was a problem hiding this comment.
Overall this looks good. Just a couple questions, that might make it easier to expand this in the future.
| CodeUri: src/HelloWorld/bin/Debug/netcoreapp2.0/publish | ||
| Handler: HelloWorld::HelloWorld.Function::FunctionHandler | ||
| {%- if cookiecutter.runtime == 'dotnetcore2.0' %} | ||
| Runtime: dotnetcore2.0 |
There was a problem hiding this comment.
Can runtime just be the value of cookiecutter.runtime?
There was a problem hiding this comment.
We could for explicit runtimes (non-defaults) but not default as we allow customers to also use the shorthand dotnet to use the latest we support.
I'll change the flow control to only hardcode a value for non-default as it'll keep it clean
There was a problem hiding this comment.
Done for explicit and valid runtime value
| "framework": "netcoreapp2.0", | ||
| "function-runtime": "dotnetcore2.0", | ||
| {%- else %} | ||
| "function-runtime": "dotnetcore2.1", |
There was a problem hiding this comment.
If there becomes a dotnetcore2.2, we will default to dotnetcore2.1.
What if we had defaults to set here and then explicitly checked the runtime for each dotnetcore version:
if runtime == dotnetcore2.0:
# stuff for 2.0 version
elif runtime == dotnetcore2.1:
# stuff for 2.1 version
else:
# default
There was a problem hiding this comment.
As of now I don't know of any VS defaults and purely following the migration guidelines. Now that you mentioned, I think it's best to explicit check runtime and remove else altogether until there are known defaults
jfuss
left a comment
There was a problem hiding this comment.
Thanks for taking the time and adding this example in! 🎉
Issue #, if available: #609
Description of changes:
dotnetis selectedBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.