Azure / Azure-Functions

1.12k stars 199 forks source link

Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0 #1226

Open lommez opened 5 years ago

lommez commented 5 years ago

I've created new Azure Function project using the VS 2017 template and after i've update the Microsoft.NET.Sdk.Functions package to version 1.0.28 i got the following:

Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0

With that exception i'm not able to debug anymore.

Is that a known bug?

panyang1217 commented 5 years ago

I've got this issue too. When a create a function with http trigger, and upgrade Sdk.Functions from 1.0.13 to 1.0.28 that exception occurred. But with TimerTrigger the function is ok.

My environment: Visual Studio 2019 + Cloud workload dotnet sdk: 2.2.103 and 2.1.700

athkim commented 5 years ago

I updated my VS2019 and I'm hitting this as well and rolling back is not working.

Stack Trace: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. File name: 'Microsoft.AspNetCore.Mvc.Abstractions, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) at System.Reflection.RuntimeMethodInfo.FetchNonReturnParameters() at System.Reflection.RuntimeMethodInfo.GetParameters() at MakeFunctionJson.MethodInfoExtensions.GetDisabled(MethodInfo method) at MakeFunctionJson.MethodInfoExtensions.HasUnsuportedAttributes(MethodInfo method, String& error) at MakeFunctionJson.FunctionJsonConverter.GenerateFunctions(IEnumerable1 types)+MoveNext() at System.Collections.Generic.List1.AddEnumerable(IEnumerable1 enumerable) at System.Linq.Enumerable.ToList[TSource](IEnumerable1 source) at MakeFunctionJson.FunctionJsonConverter.TryGenerateFunctionJsons() at MakeFunctionJson.FunctionJsonConverter.TryRun()

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

Environment: VS 2019 16.3.0 Microsoft.NET.Sdk.Functions 1.0.29 Azure Functions and Web Jobs Tools 16.3.282.33872

rybkov commented 5 years ago

Have issue with Azure Functions v3 preview. The error message is:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

Environment VS 2019 16.3.5 Microsoft.NET.Sdk.Functions 1.0.30-beta2

CarlosM2099 commented 4 years ago

Have issue with Azure Functions v3 preview. The error message is: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. Environment VS 2019 16.3.5 Microsoft.NET.Sdk.Functions 1.0.30-beta2

I was having the same problem, updating to:

https://www.nuget.org/packages/Microsoft.NET.Sdk.Functions/3.0.0-preview2

seems to have fixed it.

hbopuri commented 4 years ago

Having same issue. Did anyone got a fix or a work around to this?

System.Private.CoreLib: Could not load file or assembly 'Microsoft.AspNetCore.Mvc.Abstractions, Version=3.1.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. System.Private.CoreLib: Could not load the specified file.

ENV:

Azure Functions Core Tools (2.7.2508 Commit hash: 4da36643c32783a832094318afcd679fa9d76455) Function Runtime Version: 2.0.13351.0 AZURE_FUNCTIONS_ENVIRONMENT: Development Microsoft Visual Studio Enterprise 2019 Version 16.6.2

hbopuri commented 4 years ago

Problem was AzureFunctionsVersion, it was set to v2, changing it to v3 fixed the problem.

Edit project file and change AzureFunctionsVersion to v3

<AzureFunctionsVersion>v3</AzureFunctionsVersion>