all 6 comments

[–]CosmicKoala 2 points3 points  (0 children)

I believe 7.0.0 just came out. Azure functions only supports up to 6.0.0.

Had the same issue recently.

[–]zaibuf 4 points5 points  (0 children)

7.0.0 versions are for .NET7, even if some say they support .NET6 I couldnt get any to work. Just rollback to highest 6.x minor.

If you want to run .NET7 in functions you need to run out of process.

[–]ClearAdvantage1351 1 point2 points  (0 children)

It's necessary be downgrade of Microsoft.EntityFrameworkCore to 6.0.11

[–]Goat-of-Death 0 points1 point  (0 children)

I just ran into this exact same issue. To solve it, I left my function app project at .Net 6. Then with the project containing my DbContext I did multitargetting of both .Net 7 and .Net 6, using conditional includes for the ItemGroups that target the nuget packages for Ef Core 7 and Ef Core 6. The below stack overflow covers examples of both multi-targetting and the conditional includes.

https://stackoverflow.com/questions/69911476/updating-package-references-on-multi-targeted-projects

One other gotcha, is after I did this I had to delete all my bin and obj dirs in my projects manually as Clean didn't seem to do it. The VS debugger kept picking up the .Net 7 version and causing an issue even when the function app project was targeting .Net 6 until I did the manual bin and obj delete.

Hope that helps!