<< Update: The instructions below are still good but I did update my sample to use .NET Core 3.1 here if interested: https://github.com/jeffh...
For further actions, you may consider blocking this person and/or reporting abuse
Use Copy task instead of following. that will work on cross platform
<Exec Command="copy /Y "$(TargetDir)bin\$(ProjectName).dll" "$(TargetDir)$(ProjectName).dll"" />
docs.microsoft.com/en-us/visualstu...
Rather than using a Windows-only post build command, a MSBuild
copy
task might be a better option to support cross-platform development.github.com/dotnet/core/issues/2065...
Worth mentioning here: The BloggingContextFactory class code needs the following usings:
Also the line of code:
that is required in the startup code page just before the namespace declaration is also worth mentioning at this level.
Also the
<Target Name="PostBuild"
bit IS now not needed.
Hi @Jeff et al.
I followed the blog and set up my EF migrations successfully. One issue that I found was that I broke down my application into multiple projects like Data, Core, Function App projects. So I had to use this script to copy all DLLs:
Hello Jeff, Great news for dependency injection support in Azure Functions.
I am new to Azure. I have two questions about Azure Functions.
Question 1. Which equivalent aws database(dynamo and Aurora Serverless) I could use in Azure.
Question 2. Is there any cold-start problems for Azure Functions c#? I know there are java cold start problems in aws.
I've deployed my function to Azure by publishing from Visual Studio.
I now get the message:
Your app is currently in read only mode because you are running from a package file. To make any changes update the content in your zip file and WEBSITE_RUN_FROM_PACKAGE app setting.
Any ideas on this? Most discussions say to delete that setting and and republish, but it reappears. Also if you set it to 0 (from1) it is reset to 1 after a republish.
PS A great article.
Hmm. When I use the installed project template: Azure function it adds the SDK
Microsoft.NETCore.App (2.1)
Now following your guide I get this error:
"Package Microsoft.EntityFrameworkCore.SqlServer 3.0.1 is not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1) ... supports: netstandard2.1 (.NETStandard,Version=v2.1)"
Same thing if I lower the version number to ...SqlServer 2.2.3
How do you got this to work I have no idea?
Any suggestions would make me happy :-)
It's late I know, but somebody coming across this issue : you need to downgrade Microsoft.EntityFrameworkCore.SqlServer version to match that of Microsoft.NETCore.App
Hi Jeff
Thanks for a great post.
Using Microsoft.NET.Sdk.Functions version 3.0.9 the dll copy step must be omitted. It seems the build itself then takes care of placing the .dlls correctly.
Thank you for this!
Hey Jeff this article is ace thank you!
The MS article you linked to about DI states you need at least v1.0.28 of Microsoft.NET.Sdk.Functions will that cause issues with entity framework?
No it won't - that's actually the version I'm using. I think I mistyped 1.0.27. 28 and beyond should be great.
Cool thank you!
I loved Azure Functions before, now there is no reason not to believe they are going to take over the world :)
Ive been getting this entity framework issue when using the context to make a query. Any suggestions as to what can be done. I believe there is an issue around the DI ... github.com/Azure/azure-functions-h... ... but not entirely sure as i'm still relatively new to Azure Functions
Thanks for sharing, Jeff!
A bunch of my customers will love it.
Are you going to have the non-thread-safe issues with Entity Framework when two threads are using the same DB Context?