Azure Function gives error: System.Drawing is not supported on this platform

It’s not about the CLR, it’s about the sandbox. System.Drawing relies heavily on GDI/GDI+ to do its thing. Because of the somewhat risky nature of those APIs (large attack surface) they are restricted in the App Service sandbox. Win32k.sys (User32/GDI32) Restrictions For the sake of radical attack surface area reduction, the sandbox prevents almost all … Read more

Azure Function, EF Core, Can’t load ComponentModel.Annotations 4.2.0.0

I would suggest running this function below once you start your Azure Function. It will redirect any assembly to an existing version. public class FunctionsAssemblyResolver { public static void RedirectAssembly() { var list = AppDomain.CurrentDomain.GetAssemblies().OrderByDescending(a => a.FullName).Select(a => a.FullName).ToList(); AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; } private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var requestedAssembly = new … Read more