ExtCore
ExtCore copied to clipboard
How to use ExtCore with Azure Functions?
Hi,
is there any chance to use ExtCore with Azure Functions? If I use services.AddExtCore() in functions startup then all I get back is error: System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.DependencyModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified.'
Hello @gpeipman, I think it's due to a bad restore on azure. Here you can see what package need this dependency https://www.nuget.org/packages/Microsoft.Extensions.DependencyModel/ (section used by)
Even if you are not using ExtCore, this dependency comes via one of 5 packages including Microsoft.AspNetCore.Mvc.Core
You might have a mismatch in your framework versions. Make sure you're running the app in dotnet version >= the version you're testing on.
Yes, look your package version and pay attention to the sdk used on azure. The default sdk becomes NET 5. Be sure to specify the maximum sdk 3.1 in your Azure pipeline.
I got rid of it. There are actually some more issues. ExtCore is trying to log something during Startup. It's not supported by functions Startup as loggers are initialized and configured partially when configuring methods are called. Therefore all logging during Startup crashes. I got rid of it by implementing my own AddExtCore method.
@gpeipman Do you still have logs of this problem that we can analyze?
Hi @gpeipman, thank you for the information. I didn't think about the Azure Functions while ExtCore development. It would be amazing if you find time to write some simple TODO in the docs... And please let me know if I need to add something to the ExtCore to make it easier to have this use case working with no problems.
BTW, I've released version 6.0.0-beta1, it is based on .NET 5.0.