Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Function Targeting .NET Standard Showing Warning

Just installed Visual Studio 15.5 Preview so that I can create an Azure Function targeting .NET Core. Without making any changes, I'm seeing a warning -- see below -- that reads:

Package Microsoft.AspNet.WebApi.Client 5.2.2 was restored using .NET Framework version 4.6.1 instead of the project target framework .NET Standard version 2.0. This package may not be fully compatible with your project.

Any idea how to fix this or do I ignore this warning? As I said, this is a brand new Azure Function project I created with no changes at all.

Here's what the warning looks like: enter image description here

like image 833
Sam Avatar asked Nov 16 '17 03:11

Sam


People also ask

Does Azure functions support .NET framework?

NET Framework and only supports development in the Azure portal, Azure Stack Hub portal, or locally on Windows computers. This version is in maintenance mode, with enhancements provided only in later versions. Beginning on December 3, 2022, function apps running on versions 2.

Do Azure functions support .NET core?

NET Core 3.1 and . NET 5 Azure Functions are. As of March 2021, Microsoft announced that Azure Functions are supported running on . NET 5.

Does Azure functions support .NET 6?

NET to version 6. You can do that by updating to the new shiny Visual Studio 2022 with built-in SDK or downloading it from here: . NET 6.0 SDK. In Visual Studio 2022, Azure Functions Core Tools, necessary for developing Azure Functions, are available by adding the Azure Cloud Tool in the installation process of VS.

How do I target Azure function runtime?

Azure Functions lets you target a specific version of the runtime on Windows by using the FUNCTIONS_EXTENSION_VERSION application setting in a function app. The function app is kept on the specified major version until you explicitly choose to move to a new version.


2 Answers

You can pretty much ignore it, in this case.

Microsoft.AspNet.WebApi.Client targets "Portable Class Library (.NETFramework 4.5, Windows 0.0, WindowsPhone 8.0, WindowsPhone 8.1, WindowsPhoneApp 8.1)" (or net45+win8+win81 as it's the target framework moniker called), which means it's fully compatible with .NET Core and .NET Standard (>= 1.2).

The warning comes, because it do not target the netstandard1.x or netstandard2.x moniker specifically. It just tell you "this might not be compatible on .NET Core/.NET Standard".

like image 156
Tseng Avatar answered Oct 20 '22 08:10

Tseng


Yes, you did nothing wrong: this is to be expected for now. Functions v2 are in beta now, so you'd have to live with this warning for a while. It should give you no functional issues.

like image 23
Mikhail Shilkov Avatar answered Oct 20 '22 09:10

Mikhail Shilkov