没有代码更改或程序包更新,仅是VS Studio 2017中Azure功能的扩展程序更新。我添加了Nuget程序包,将其删除,尝试绑定重定向。似乎没有任何作用。
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
我能够使用这些Nuget依赖关系创建一个全新的空白Function App csproj,并重现错误
<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" />
最佳答案
Azure Functions扩展升级后,Azure Functions项目遇到System.ValueTuples错误
我可以使用版本1.0.8的nuget软件包Microsoft.NET.Sdk.Functions
重现此问题。
升级Azure Functions扩展后,在Visual Studio 2017中创建一个Azure Functions项目,然后将nuget包更新为Azure Functions SDK 1.0.8
,生成该项目,并得到与您相同的错误(不需要添加任何其他nuget包)。但是,如果我将该nuget软件包降级为1.0.6版,则该项目将正常运行,因此,此问题应与软件包Microsoft.NET.Sdk.Functions 1.0.8
的最新版本更为相关。在Github上检查same issue。
要解决此问题,我删除了netstandard1.0文件夹:
"C:\Users\name.nuget\packages\microsoft.net.sdk.functions\1.0.8\build\netstandard1.0
但是我注意到您的项目文件中的版本仍然是1.0.6:
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.6" />
因此,请将该软件包更新为1.0.8,然后在nuget软件包
microsoft.net.sdk.functions
中删除文件夹netstandard1.0。之后,我可以完成构建:
希望这可以帮助。
关于asp.net - Azure Functions扩展升级后,Azure Functions项目遇到System.ValueTuples错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/49000619/