Reputation: 2849
I have been using Azure Functions for the last month and have been happily creating them as V2 (.Net Standard)
Now after the most recent update I can only create V2 as (.Net Core), and these don't seem to be compatible with the old type.
Do I really need to port all my old functions into this new type? This is the error I get when trying to reference a new function in an old function.
Project is not compatible with netstandard2.0 (.NETStandard,Version=v2.0). Project supports: netcoreapp2.0 (.NETCoreApp,Version=v2.0)
Upvotes: 2
Views: 3377
Reputation: 17790
For now, netstandard2.0(old template for a long time) and netcoreapp2.1(updated several days ago) target framework both work. The function runtime 2.x is based on .Net Core env from the very beginning so this TF change should have no effect on functions built before, just offer access to .Net Core APIs and related dependencies.
But we can't reference projects targeting at different framework, we have to change TF to achieve compatibility. Right click on project and Edit <FunctionProjectName>.csproj
.
See default TF in new template. (Update VS to latest 15.8.8 to consume latest .Net Core 2.1.)
<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
</PropertyGroup>
We can modify new project back to TF netstandard2.0, but I recommend to update old projects to netcoreapp2.1 for long term compatibility. Remember to update Microsoft.NET.Sdk.Functions
to 1.0.*
(i.e. the latest) in old projects.
Upvotes: 3