Shane
Shane

Reputation: 4315

Azure Functions project gets System.ValueTuples error after Azure Functions extension upgrade

No code changes or package updates, just the Extensions update for Azure Functions in VS Studio 2017. I've added the Nuget package, removed it, trying binding redirects. Nothing seems to work.

Severity    Code    Description Project File    Line    Suppression State
Error       System.IO.FileNotFoundException: Could not load file or assembly 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.
File name: 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
   at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
   at MakeFunctionJson.FunctionJsonConverter.TryRun()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Error generating functions metadata
    Functions   C:\Users\aiueru7\.nuget\packages\microsoft.net.sdk.functions\1.0.8\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets   39  

I was able to create a brand new blank Function App csproj with these Nuget dependencies and reproduce the error

<PackageReference Include="AWSSDK.S3" Version="3.3.11.4" />
<PackageReference Include="CqrsLite" Version="0.18.1" />
<PackageReference Include="Microsoft.Azure.DocumentDB" Version="1.20.2" />
<PackageReference Include="Microsoft.Azure.Management.CosmosDB.Fluent" Version="1.6.0" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="2.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.ServiceBus" Version="2.1.0" />
<PackageReference Include="Microsoft.CrmSdk.XrmTooling.CoreAssembly" Version="8.2.0.5" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.6" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="SimpleInjector" Version="4.0.12" />
<PackageReference Include="System.ValueTuple" Version="4.4.0" />

Upvotes: 2

Views: 1819

Answers (1)

Leo Liu
Leo Liu

Reputation: 76918

Azure Functions project gets System.ValueTuples error after Azure Functions extension upgrade

I can reproduce this issue with nuget package Microsoft.NET.Sdk.Functions with version 1.0.8.

After upgrading Azure Functions extension, create an Azure Functions project in Visual Studio 2017, then update the nuget package to Azure Functions SDK 1.0.8, build the project, got the same error as you (Not need add any other nuget package). However, if I degrade that nuget package to the version 1.0.6, the project works fine, so this issue should be more related to the latest version of package Microsoft.NET.Sdk.Functions 1.0.8. Check the same issue on Github.

To resolve this issue, I deleted the netstandard1.0 folder:

"C:\Users\name.nuget\packages\microsoft.net.sdk.functions\1.0.8\build\netstandard1.0

But I noticed that the version in your project file is still 1.0.6:

<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.6" />

So please update that package to the 1.0.8, then delete the folder netstandard1.0 in the nuget package microsoft.net.sdk.functions.

After that I could complete the build:

enter image description here

Hope this helps.

Upvotes: 11

Related Questions