EF errors when using Azure Functions?
Posted: Sun 29 Apr 2018 09:46
Hi,
I have a requirement to use DotConnect Postgresql EF from an Azure Function which targets .Net Standard 2.0.
I'm generating the model (database first) using the Wizard but when running the function app I get the errors below.
I've done some experimentation and have observed the following:
- The errors dissappear when I remove the Datamodels that have been generated
- LinqConnect works absolutely fine and I am able to generate a database first model using exactly the same function. The only reason I'm not using LinqConnect is because I need to query JSONB.
- A Console app targetting .Net Standard works perfectly.
Any ideas?
Errors:
Warning: Only got partial types from assembly: FunctionAppExperimentalCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Exception message: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.Azure.WebJobs.Host.Indexers.DefaultTypeLocator.FindTypes(Assembly assembly, IEnumerable`1 extensionAssemblies) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\DefaultTypeLocator.cs:line 120
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
I have a requirement to use DotConnect Postgresql EF from an Azure Function which targets .Net Standard 2.0.
I'm generating the model (database first) using the Wizard but when running the function app I get the errors below.
I've done some experimentation and have observed the following:
- The errors dissappear when I remove the Datamodels that have been generated
- LinqConnect works absolutely fine and I am able to generate a database first model using exactly the same function. The only reason I'm not using LinqConnect is because I need to query JSONB.
- A Console app targetting .Net Standard works perfectly.
Any ideas?
Errors:
Warning: Only got partial types from assembly: FunctionAppExperimentalCode, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
Exception message: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.Azure.WebJobs.Host.Indexers.DefaultTypeLocator.FindTypes(Assembly assembly, IEnumerable`1 extensionAssemblies) in C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Indexers\DefaultTypeLocator.cs:line 120
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.