Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2016

Azure Functions not compatible with 2.4.4

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.4.4
    • Component/s: Testing
    • Labels:
      None
    • Environment:
      Windows 10 Enterprise 14393.1480
      Visual Studio 2017 Community Edition 15.3.0 Preview 4.0
      Existing Microsoft Azure account

      Follow https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio for the full setup of VS 2017 with Azure Functions

      Try to run the attached project locally. When calling the function, the following error is generated:

      ```json

      {"id":"3003c9cc-40e8-4439-b45d-48d9d59ef1b3","requestId":"e5cd7ecc-6bbf-41a5-aa87-ca3bdc3b6139","statusCode":500,"errorCode":0,"messsage":"Exception while executing function: Functions.HttpTriggerCSharp -> Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.","errorDetails":"Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: Functions.HttpTriggerCSharp ---> System.IO.FileNotFoundException : Could not load file or assembly 'System.Runtime.InteropServices.RuntimeInformation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.\r\n at MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateOSDocument()\r\n at System.Lazy`1.CreateValue()\r\n at System.Lazy`1.LazyInitValue()\r\n at System.Lazy`1.get_Value()\r\n at MongoDB.Driver.Core.Connections.ClientDocumentHelper.CreateClientDocument(String applicationName)\r\n at MongoDB.Driver.Core.Connections.BinaryConnectionFactory..ctor(ConnectionSettings settings,IStreamFactory streamFactory,IEventSubscriber eventSubscriber)\r\n at MongoDB.Driver.Core.Configuration.ClusterBuilder.BuildCluster()\r\n at MongoDB.Driver.ClusterRegistry.CreateCluster(ClusterKey clusterKey)\r\n at MongoDB.Driver.ClusterRegistry.GetOrCreateCluster(ClusterKey clusterKey)\r\n at MongoDB.Driver.MongoClient..ctor(MongoClientSettings settings)\r\n at MongoDB.Driver.MongoClient..ctor()\r\n at async CreateMongoDBDoc.CreateDocFunction.Run(HttpRequestMessage req,TraceWriter log)\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at async Microsoft.Azure.WebJobs.Script.Description.FunctionInvokerBase.Invoke(Object[] parameters)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker`1.InvokeAsync[TReflected](Object[] arguments)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker,Object[] invokeParameters,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInstance instance)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance instance,IReadOnlyDictionary`2 parameters,TraceWriter traceWriter,ILogger logger,CancellationTokenSource functionCancellationTokenSource)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) \r\n End of inner exception\r\n at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??)\r\n at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsync(IFunctionInstance functionInstance,CancellationToken cancellationToken)\r\n at Microsoft.Azure.WebJobs.Host.Executors.ExceptionDispatchInfoDelayedException.Throw()\r\n at async Microsoft.Azure.WebJobs.JobHost.CallAsyncCore(MethodInfo method,IDictionary`2 arguments,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.ScriptHost.CallAsync(String method,Dictionary`2 arguments,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostManager.HandleRequestAsync(FunctionDescriptor function,HttpRequestMessage request,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.ProcessRequestAsync(HttpRequestMessage request,FunctionDescriptor function,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.<>c__DisplayClass3_0.<ExecuteAsync>b__0(??)\r\n at async Microsoft.Azure.WebJobs.Extensions.Http.HttpRequestManager.ProcessRequestAsync(HttpRequestMessage request,Func`3 processRequestHandler,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.ExecuteAsync(HttpControllerContext controllerContext,CancellationToken cancellationToken)\r\n at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.SystemTraceHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.WebScriptHostHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)\r\n at async System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)"}

      ```

      If you revert to 2.3 of the MongoDB driver, the function works fine (and connects to an Atlas)

            Assignee:
            Unassigned Unassigned
            Reporter:
            raphael.londner Raphael Londner
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: