Severity Code Description Project File Line Suppression State
Error System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at MakeFunctionJson.FunctionJsonSchema..ctor()
at MakeFunctionJson.MethodInfoExtensions.ToFunctionJson(MethodInfo method, String assemblyPath)
at MakeFunctionJson.FunctionJsonConverter.<GenerateFunctions>d__9.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons()
at MakeFunctionJson.FunctionJsonConverter.TryRun()
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable C:\Users\Coenraad\.nuget\packages\microsoft.net.sdk.functions\1.0.23\tools\net46\Microsoft.NET.Sdk.Functions.Generator.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: DisplayName = Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
(Fully-specified)
LOG: Appbase = file:///C:/Users/Coenraad/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.NET.Sdk.Functions.Generator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
LOG: Attempting download of new URL file:///C:/Users/Coenraad/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions.DLL.
LOG: Attempting download of new URL file:///C:/Users/Coenraad/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions/Microsoft.NET.Sdk.Functions.DLL.
LOG: Attempting download of new URL file:///C:/Users/Coenraad/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions.EXE.
LOG: Attempting download of new URL file:///C:/Users/Coenraad/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions/Microsoft.NET.Sdk.Functions.EXE.
Error generating functions metadata
FunctionsHourRetry C:\Users\Coenraad\.nuget\packages\microsoft.net.sdk.functions\1.0.23\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets 41

Exactly, I have the same issue
Same here. Went back to 1.0.22 and it works fine.
I had a related issue but the file that was not found was for Microsoft.Azure.WebJobs.Extensions.ServiceBus
VS also won't start my functions on 1.0.23 - it says that it can't start projects of type class library. Going back to 1.0.22 solves both issues, across f# and c#.
It seems to be related to having the function Platform Target set to x64, even though I made sure I downloaded the x64 tooling. If I set it to Any CPU it works.
Going back to 1.0.22 worked for me too.
I have this problem too.
I have same problem
Same here
same for me.
Same here.
Setting the AzureFunctionsVersion to v2 in the csproj and rebuilding fixed it for me.
<AzureFunctionsVersion>v2</AzureFunctionsVersion>
I originally created this project in VS Code and then started using it in Visual Studio, so I'm guessing that has something to do with it.
@emcondra Thanks for that. This fixed it for me.
@emcondra solved my problem, thanks
Interestingly I bumped my version from 1.0.22 to 1.0.23 today and it didn't fail at compile time. I did notice a Visual Studio update to Azure Functions and Web Jobs Tools yesterday which may have helped. I do have the
Confirm it still happens in v1 function with latest Azure Functions and Web Jobs Tools 15.10.2046. Related issue.
@emcondra thank you, fixed my problem
Unfortunately I need to use the full .NET framework still and cannot move to v2.
This problem appears to be related to the naming of the files. By turning on extended logging it is looking for files with a different name than what is actually in the folder. The files are actually Microsoft.NET.Sdk.Functions.Generator.exe and Microsoft.NET.Sdk.Functions.MSBuild.dll. I tried to put some links in but the internal file names need to match or it won't work.
error : === Pre-bind state information ===
error : LOG: DisplayName = Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
error : (Fully-specified)
error : LOG: Appbase = file:///C:/Users/User/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/
error : LOG: Initial PrivatePath = NULL
error : Calling assembly : Microsoft.NET.Sdk.Functions.Generator, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
error : ===
error : LOG: This bind starts in default load context.
error : LOG: No application configuration file found.
error : LOG: Using host configuration file:
error : LOG: Using machine configuration file from C:WindowsMicrosoft.NETFramework64v4.0.30319configmachine.config.
error : LOG: Post-policy reference: Microsoft.NET.Sdk.Functions, Version=1.0.23.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
error : LOG: Attempting download of new URL file:///C:/Users/User/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions.DLL.
error : LOG: Attempting download of new URL file:///C:/Users/User/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions/Microsoft.NET.Sdk.Functions.DLL.
error : LOG: Attempting download of new URL file:///C:/Users/User/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions.EXE.
error : LOG: Attempting download of new URL file:///C:/Users/User/.nuget/packages/microsoft.net.sdk.functions/1.0.23/tools/net46/Microsoft.NET.Sdk.Functions/Microsoft.NET.Sdk.Functions.EXE.
error :
error : Error generating functions metadata
error :
error : Metadata generation failed.
1> 0 Warning(s)
1> 2 Error(s)
1>
1>Time Elapsed 00:00:00.62
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Same issue, can't switch to v2 because of lack of DI.
Thank you for reporting this. This is indeed a packaging issue and is being addressed. In the meantime, if targeting Azure Functions V1, the workaround mentioned above or downgrading to 1.0.22 should address the issue.
Just for the records, I had a similar problem today during the migration to .net core 2.1:
C:\Users\mario\.nuget\packages\microsoft.net.sdk.functions\1.0.23\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets(41,5): error : System.IO.FileNotFoundException: Could not load file or assembly 'FSharp.Core, Version=4.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. O sistema n茫o pode encontrar o arquivo especificado.
To fix this I needed to add the dependencies inside my .fsproj file:
<ItemGroup>
<PackageReference Include="FSharp.Core" Version="4.5.2" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.0.0" />
....
For sake of completeness, this is my paket.references file:
source https://www.nuget.org/api/v2
framework: netstandard2.0
nuget FSharp.Core >= 4.5.2
nuget Microsoft.NET.Sdk.Functions >= 1.0.23
nuget Microsoft.AspNetCore.Mvc.Core
nuget Microsoft.Azure.WebJobs.Extensions.CosmosDB >= 3.0.1
nuget Microsoft.Azure.WebJobs.Extensions.EventGrid >= 2.0.0
nuget Microsoft.Azure.WebJobs.Extensions.SignalRService >= 1.0.0-preview1-10002
nuget FSharp.Interop.Dynamic
group Build
source https://www.nuget.org/api/v2
nuget FAKE
Fixing the fsproj file allowed the build to run fine.
Fixed in #258. Should be released within the week.
@mariomeyrelles this issue is a bit different.
Microsoft.NET.Sdk.Functions 1.0.24, with the fix @maiqbal11 mentioned above, has been published to NuGet
In case anyone is reading in March 2019, downgrading to version 1.0.22 or upgrading to 1.0.26 solves this issue for me when trying to create an F# Azure function
@emcondra, thank you, that solved my problem too. Also, I confirm this works for .NET Core 2.2 and Microsoft.NET.Sdk.Functions 1.0.29
Most helpful comment
Setting the AzureFunctionsVersion to
v2in the csproj and rebuilding fixed it for me.<AzureFunctionsVersion>v2</AzureFunctionsVersion>I originally created this project in VS Code and then started using it in Visual Studio, so I'm guessing that has something to do with it.