aws-lambda-dotnet icon indicating copy to clipboard operation
aws-lambda-dotnet copied to clipboard

Misleading error when .Net Core SDK not installed

Open FireInWinter opened this issue 5 years ago • 1 comments

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'
}

FireInWinter avatar Jul 19 '19 17:07 FireInWinter

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.

github-actions[bot] avatar Aug 12 '22 00:08 github-actions[bot]