Azure / azure-functions-vs-build-sdk

MSBuild task for Azure Functions
MIT License
99 stars 66 forks source link

Can't build project after upgrade Microsoft.EntityFrameworkCore, Version=2.1.1.0 #224

Closed vovikdrg closed 5 years ago

vovikdrg commented 6 years ago
  <ItemGroup>    
    <PackageReference Include="Autofac" Version="4.8.1" />    
    <PackageReference Include="AutoMapper" Version="7.0.1" />    
    <PackageReference Include="Flymark.Common.Dto" Version="0.7.1388" />    
    <PackageReference Include="ImageResizer" Version="4.2.5" />    
    <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.1.2" />    
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.13" />    
    <PackageReference Include="NEST" Version="6.2.0" />    
    <PackageReference Include="Newtonsoft.Json" Version="11.0.2" />    
    <PackageReference Include="Westwind.RazorHosting" Version="3.3.0" />    
    <PackageReference Include="WindowsAzure.Storage" Version="9.3.1" />
  </ItemGroup>

Error:

Severity Code Description Project Path File Line Suppression State Error System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.EntityFrameworkCore, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. The system cannot find the file specified. File name: 'Microsoft.EntityFrameworkCore, Version=2.1.1.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.d__9.MoveNext() at System.Collections.Generic.List1..ctor(IEnumerable1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source) 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 Background.Processor C:\Users\vovik.nuget\packages\microsoft.net.sdk.functions\1.0.14\build\netstandard1.0 C:\Users\vovik.nuget\packages\microsoft.net.sdk.functions\1.0.14\build\netstandard1.0\Microsoft.NET.Sdk.Functions.Build.targets 39

vovikdrg commented 6 years ago

After rollback EFCore from 2.1.2(3) to 2.1.1 it works.

slaneyrw commented 6 years ago

Same issue, but I can't role back as I'm using ASPNETCore Identity EF. Builds fine from "dotnet build"

Adding the following to the .csproj file makes it build again

`

true

`

jeffhollan commented 5 years ago

What version of the Azure Functions runtime are you using?

<TargetFramework>netstandard2.0</TargetFramework>
<AzureFunctionsVersion>v2</AzureFunctionsVersion>

My guess is that this is v1 (net461) and if so likely related to limitations in assemblies allowed that was resolved in v2

vovikdrg commented 5 years ago

@jeffhollan v1. Still in processes of migration :( to v2.

jeffhollan commented 5 years ago

Understandable. Let me know if anything else blocking you from v2 that we could help with. That said going to close for now as a known gap and workaround is to follow guidance in the linked doc as a potential fix, though official guidance is "this should work out of box in v2"