Target .NET Core 2.0 with Azure Functions in Visual Studio 2017

NOP-MOV picture NOP-MOV · Oct 6, 2017 · Viewed 10.1k times · Source

Since Microsoft has released .NET Core 2.0 for Azure Functions a few days ago, I'm trying to understand how to create a new Functions project in VS2017 targeting .NET Core.

I've tried many configurations and still ended up with .NET 4.7.

Did anyone manage to create a new Function targeting .NET Core?

Thanks.

Answer

Fabio Cavalcante picture Fabio Cavalcante · Oct 6, 2017

This is supported with the 1.0.5 release of the Microsoft.NET.Sdk.Functions package.

In your Azure Functions Project, do the following:

  • Update the Microsoft.NET.Sdk.Functions package version to 1.0.5
  • Right click on your project, click the Edit <projectname>.csproj option and modify the TargetFramework element value to netstandard2.0

This will should generate .NET Standard 2.0 assemblies with all the artifacts created by the Azure Functions tooling.