Publish to AWS… Missing from Visual Studio 2017

老子叫甜甜 提交于 2019-12-11 12:18:02

问题


I am trying to publish a lambda function to AWS but my VS Solution Explorer's Project right-click menu does not have Publish to AWS... option in Visual Studio 2017. This was there just a day back. How or can the Publish to AWS... be added to the Visual Studio 2017 right click menu?


回答1:


  1. You need to add the Amazon.Lambda.Tools package to your project using the nuget package manager
  2. If adding the package using nuget fails, add these lines to your .csproj file inside the <project> tags

    
    <ItemGroup>
        <DotNetCliToolReference Include="Amazon.Lambda.Tools" Version="1.8.0" />
    </ItemGroup>
    
    



回答2:


I ran into the same problem when creating a new .net core app independent of using one of the Lambda template projects. First, I followed this answer to install the tools globally (you no longer need to add to your csproj): https://stackoverflow.com/a/52448951/407188.

That worked great to install the tools locally, but I still couldn't get the right-click "Publish to Lambda" menu to show up. I tried many of the other suggestions including the above but ultimately found my csproj file was missing the following line

<AWSProjectType>Lambda</AWSProjectType>

... located as follows

<PropertyGroup>
   <TargetFramework>netcoreapp2.1</TargetFramework>

   <!--The new property indicating to AWS Toolkit for Visual Studio this is a Lambda project-->
   <AWSProjectType>Lambda</AWSProjectType>      
</PropertyGroup>

More details of this change can be found at https://github.com/aws/aws-extensions-for-dotnet-cli

Finally, I now see



来源:https://stackoverflow.com/questions/50312528/publish-to-aws-missing-from-visual-studio-2017

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!