CLI 2.0 Preview doesn't seem to work with EFCore 2.0
I'm trying to build a function app that leverages EF Core 2.0. Since EF Core 2.0 target's .NET Standard 2.0, I'm testing this out using the CLI 2.0 Preview.
First, I installed this:
npm i -g [email protected]
Then when I try to run my function app (via func host start --port 7071 --pause-on-error in the bin\Debug\net47 directory) I see this:
Starting Host (HostId=<removed>, Version=2.0.11280.0, ProcessId=656, Debug=False, Attempt=0)
I assume that the 2.0.11280.0 confirms that I'm running CLI 2.0
The function is recognized by the host and the host awaits a GET to https://localhost:7071/api/Applications
When I navigate my browser to https://localhost:7071/api/Applications, I get the following error:
[9/25/2017 6:01:32 PM] A ScriptHost error has occurred
[9/25/2017 6:01:32 PM] Exception while executing function: Applications. Service: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
[9/25/2017 6:01:32 PM] Exception while executing function: Applications
[9/25/2017 6:01:32 PM] Exception while executing function: Applications. Service: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
[9/25/2017 6:01:32 PM] Function completed (Failure, Id=2c2432cc-462b-4826-a86a-0df85bda2542, Duration=231ms)
[9/25/2017 6:01:32 PM]
[9/25/2017 6:01:32 PM] Executed 'Applications' (Failed, Id=2c2432cc-462b-4826-a86a-0df85bda2542)
[9/25/2017 6:01:32 PM] System.Private.CoreLib: Exception while executing function: Applications. Service: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
[9/25/2017 6:01:32 PM] Function had errors. See Azure WebJobs SDK dashboard for details. Instance ID is '2c2432cc-462b-4826-a86a-0df85bda2542'
[9/25/2017 6:01:32 PM] System.Private.CoreLib: Exception while executing function: Applications. Service: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (Exception from HRESULT: 0x80131621). System.Private.CoreLib: Could not load file or assembly 'System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.
I've attached a small sample solution that repros this issue. The solution consists of three projects: the function app, and two class libraries that contain "data access" logic. In each project I updated:
-
the target framework to 4.7

-
the language version to C# 7.1

Am I doing something wrong here? Is this another example of the issue described here: dotnet/standard#481?
Sorry, I meant to post this in Azure/azure-functions-cli
Azure/azure-functions-cli#253