I'm facing an issue on publish step in VSCode for Azure function. The error log is below:-
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : It was not possible to find any compatible framework version [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : The framework 'Microsoft.NETCore.App', version '2.1.0' was not found. [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : - The following frameworks were found: [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : 3.1.4 at [/usr/share/dotnet/shared/Microsoft.NETCore.App] [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : You can resolve the problem by installing the specified framework and/or SDK. [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : The specified framework can be found at: [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : - https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=ubuntu.18.04-x64 [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
/home/amit/.nuget/packages/microsoft.net.sdk.functions/1.0.29/build/netstandard1.0/Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : Metadata generation failed. [/home/amit/Desktop/Projects/Barco/azure-iot-edge-identity-translation-lite/src/cloud/functions/LeafDeviceIoTHubRegistration.csproj]
Im on an Ubuntu 18.04 machine with dotnet --version is 3.1.300
The sample uses .NET Core 2.1 so you'll need to install that version on your dev machine as well. Versions 2 and 3 can be installed side by side so should not be an issue.
I'm facing an issue on publish step in VSCode for Azure function. The error log is below:-
Im on an Ubuntu 18.04 machine with
dotnet --version
is3.1.300