aws-lambda-dotnet
aws-lambda-dotnet copied to clipboard
Misleading error when .Net Core SDK not installed
The function _validateDotnetInstall tries to check if the .Net Core SDK is install by doing the following.
$application = Get-Command -Name dotnet
if (!($application))
{
throw '.NET Core 2.1 SDK was not found which is required to build the PowerShell Lambda package bundle. Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download'
}
You get this error first, which distracted me from the real issue.
The term 'dotnet' is not recognized as the name of a cmdlet, function, script file, or operable program.
The message about needing to install .NET Core 2.1 SDK is displayed second, but isn't the first thing users look at. Probably just need to add a "-ErrorAction SilentlyContinue" to the Get-
Command to get it to work correctly. It appears that other calls to Get-Command already do this.
if ( -not (Get-Command -Name dotnet -ErrorAction SilentlyContinue ))
{
throw '.NET Core 2.1 SDK was not found which is required to build the PowerShell Lambda package bundle. Download the .NET Core 2.1 SDK from https://www.microsoft.com/net/download'
}
We have noticed this issue has not received attention in 1 year. We will close this issue for now. If you think this is in error, please feel free to comment and reopen the issue.