question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When EF7 RC is referenced from a Function App, the app throws a runtime error on startup

See original GitHub issue

A minimal reproduceable repo is here: https://github.com/elninoisback/ef7rc-fnapp-issue

The following error is thrown in the console when the function app startsup. It goes away when you remove the ef core dependancy,

The 'Function1' function is in error: Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.

The following is my .csproj file of the function app.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <TargetFramework>net6.0</TargetFramework>
    <AzureFunctionsVersion>v4</AzureFunctionsVersion>
    <RootNamespace>ef7rc_fnapp_issue</RootNamespace>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0-rc.1.22426.7" />
    <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.1.1" />
  </ItemGroup>
  <ItemGroup>
    <None Update="host.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
    <None Update="local.settings.json">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
      <CopyToPublishDirectory>Never</CopyToPublishDirectory>
    </None>
  </ItemGroup>
</Project>

EF Core version: 7.0.0-rc.1.22426.7 Database provider: (e.g. Microsoft.EntityFrameworkCore.SqlServer) Target framework: (e.g. .NET 6.0) Operating system: Windows 10 Pro IDE: Visual Studio Enterprise 2022

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
AraHaancommented, Sep 18, 2022

hmm looks to me that the aspnetcore shared framework is referenced right? if so ensure that:

    <!-- We need to enable this. -->
    <GenerateDependencyFile>true</GenerateDependencyFile>

in the csproj of the function application.

1reaction
AraHaancommented, Sep 17, 2022

Currently I would recommend for you to test this with .NET 7’s TFM and see if you can still reproduce it with that as well.

Read more comments on GitHub >

github_iconTop Results From Across the Web

When EF7 RC is referenced from a Function App, the app ...
The following error is thrown in the console when the function app startsup. It goes away when you remove the ef core dependancy,....
Read more >
Troubleshoot error: Azure Functions Runtime is unreachable
The most common reason for this is that the function app has lost access to its storage account.
Read more >
Azure Functions Portal error - The function runtime is ...
The function Runtime is unable to start which states: changed the FUNCTIONS_EXTENSION_VERSION to ~1 and restarted, and it looks like things ...
Read more >
New aggregate function support in EF Core 7 - YouTube
Aggregate functions such as COUNT, MAX or AVG compute a single value from multiple rows. EF7 adds support for custom provider aggregate ...
Read more >
Ef core 6 breaking changes. Replace this call in 'MyFunction (s
Ef core 6 breaking changes. Replace this call in 'MyFunction (string, string)' with a call to 'string. EF6 requires changes to app. 2...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found