1

Relatively new to the windows ecosystem. After following the windows documentation on setting up a background application on iot and google's quickstart for C#, I am receiving this error that I cannot seem to solve:

System.IO.IOException: 'Error loading native library "C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\BackgroundAppFirestoreOne-uwpVS.Debug_ARM.usernoname\grpc_csharp_ext.x86.dll". '

Stack Trace:

System.IO.IOException
  HResult=0x80131620
  Message=Error loading native library "C:\Data\Users\DefaultAccount\AppData\Local\DevelopmentFiles\BackgroundAppFirestoreOne-uwpVS.Debug_ARM.usernoname\grpc_csharp_ext.x86.dll". 
  Source=Grpc.Core
  StackTrace:
   at Grpc.Core.Internal.UnmanagedLibrary..ctor(String[] libraryPathAlternatives)
   at Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()
   at Grpc.Core.Internal.NativeExtension.LoadNativeMethods()
   at Grpc.Core.Internal.NativeExtension..ctor()
   at Grpc.Core.Internal.NativeExtension.Get()
   at Grpc.Core.GrpcEnvironment.GrpcNativeInit()
   at Grpc.Core.GrpcEnvironment..ctor()
   at Grpc.Core.GrpcEnvironment.AddRef()
   at Grpc.Core.Channel..ctor(String target, ChannelCredentials credentials, IEnumerable`1 options)
   at Grpc.Core.Channel..ctor(String host, Int32 port, ChannelCredentials credentials, IEnumerable`1 options)
   at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint endpoint, IEnumerable`1 channelOptions, ChannelCredentials credentials)
   at Google.Api.Gax.Grpc.ChannelPool.GetChannel(ServiceEndpoint endpoint, IEnumerable`1 channelOptions)
   at Google.Cloud.Firestore.FirestoreDb.Create(String projectId, FirestoreClient client)
   at BackgroundAppFirestoreOne.StartupTask.<Run>d__4.MoveNext() in C:\Users\usernoname\source\repos\BackgroundAppFirestoreOne\StartupTask.cs:line 95

The file is in the directory and does have the necessary permissions.

My environment:

Developing on Windows 10 with Visual Studios 2019 Enterprise

Deploying to a Dragonboard 410c with Windows 10 iot Core

Google.Cloud.Firestore NuGet referenced

I've tried:

Adding the gRPC.core as this suggested, as a NuGet package reference in VS2019, this did not solve the issue.

And I don't have any non-English characters as this suggests.

This error occurs when attempting to execute FirestoreDb db = FirestoreDb.Create(project); (see line 44 of sample)

Does anyone know what this could be / what I could try to rectify?

2
  • is the DLL listed in the IOException an x86 DLL? The filename seems to indicate that it is. You're wanting to compile for ARM. Commented May 5, 2020 at 11:20
  • 1
    What you're doing is not supported. Grpc.Core does not provide a pre-compiled version of the grpc_csharp_ext for ARM. Therefore it will never work unless you hack things manually is a way that you provide a custom-build grpc_csharp_ext that targets ARM. Commented May 11, 2020 at 16:03

1 Answer 1

1

I did not encount the exception with Google.Cloud.Firestore 1.1.0 on Windows IoT Core 17763. Could you please check the package version and OS version. BTW, it is not recommended to use the package in background app, since at the moment you can't register a headless app that uses filetypeAssociation, so that the app can not access the credential file(.json).

Sign up to request clarification or add additional context in comments.

6 Comments

Hmm, yes I'm using Google.Cloud.Firestore 1.1.0 on Windows IoT Core 17763. That's an interesting statement. I imagine most applications in the internet of things are headless, what is the upside of restricting fileTypeAssociation? Would Microsoft recommend packaging it in a regular IoT UWP setup to run without user interaction instead of setting up as a background application? Or is it anything headless and not just a background app? Also, couldn't find this in a quick search, could you link me to the registration restrictions for headless apps? I greatly appreciate your insights here.
Foreground apps are given the most memory and execution time; background apps get less.There is no document to list the restrictions for background app. Let's go back to the original topic, i installed the gRPC.core via nuget successfully. What is the min version and target version of your project? If possible, you may upload your sample project.
I tried gRPC.core (2.28.1 and then 1.22.1 when there was a warning that the firestore package required version within a range that 1.22.1 satisfied), installed via nuget successfully, but did not solve the issue. Min Version is 17134, Target is 18362. 17763 is being used.
@ripley.sherlock, i have tried to run your project on my device, there is no IOException.Please try to reflash the Windows IoT Core.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.