[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error loading native library." after change to load service account creds from JSON #7873

Closed
lukepuplett opened this issue Jan 20, 2022 · 2 comments

Comments

@lukepuplett
Copy link
lukepuplett commented Jan 20, 2022
(field) static readonly Testing.FirestoreStorageTestHelper FirestoreRepositoryTests.firestoreTestHelper
Test method MyProject.Data.Repositories.FirestoreRepositoryTests.FirestoreAccountDocRepository_InsertAsync__inserts_to_db threw exception: 
System.IO.FileNotFoundException: Error loading native library. Not found in any of the possible locations: /Users/lukepuplett/Documents/Git/MyProject/tests/MyProject.Web.Application.Tests/bin/Debug/net6.0/libgrpc_csharp_ext.arm64.dylib,/Users/lukepuplett/Documents/Git/MyProject/tests/MyProject.Web.Application.Tests/bin/Debug/net6.0/runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib,/Users/lukepuplett/Documents/Git/MyProject/tests/MyProject.Web.Application.Tests/bin/Debug/net6.0/../../runtimes/osx-arm64/native/libgrpc_csharp_ext.arm64.dylib

Environment details

.NET SDK (reflecting any global.json):
 Version:   6.0.100
 Commit:    9e8b04bbff

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  12.1
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/6.0.100/

Host (useful for support):
  Version: 6.0.0
  Commit:  4822e3c3aa

.NET SDKs installed:
  6.0.100 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Here's a search for that file (others like it).

*[master][~/Documents/Git/MyProject]$ find . -type f -name "*.arm64.*"
./tests/MyProject.Web.Application.Tests/bin/Debug/net6.0/runtimes/linux-arm64/native/libgrpc_csharp_ext.arm64.so
./tests/MyProject.AspNetCoreMvc.Tests/bin/Debug/net6.0/runtimes/linux-arm64/native/libgrpc_csharp_ext.arm64.so
./src/MyProject.AspNetCoreMvc/bin/Debug/net6.0/runtimes/linux-arm64/native/libgrpc_csharp_ext.arm64.so

Package name and version

    <!-- test project -->
    <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
    <PackageReference Include="MSTest.TestAdapter" Version="2.2.8" />
    <PackageReference Include="MSTest.TestFramework" Version="2.2.8" />
    ... etc.

    <!-- data project -->
    <PackageReference Include="Google.Cloud.Firestore" Version="2.5.0" />
    <PackageReference Include="Grpc.Core" Version="2.43.0" />
    ... etc.

Note - I added direct dependencies to Google.Cloud.Firestore and Grpc.Core to my test project as an experiment but it didn't work.

Note - I was running pretty old test SDK libs and updated them all.

Note - I have never had any running code (app or test) yet as I'm in the midst of a migration to GCP.

Steps to reproduce

I've not checked the reproducibility but the error began after adding code to read credentials from a JSON file instead of using ADC during FirebaseDb initialization.

Comments

I'm aware of other issues logged for this error but I've not had any joy with Grpc.Core nor with changing my test libs. It seems unusual to me to get this kind of error in .NET anyway.

@jskeet
Copy link
Collaborator
jskeet commented Jan 20, 2022

Basically this is a duplicate of #7560. See that issue for a workaround and longer-term plans.

@lukepuplett
Copy link
Author

Hey Jon. Actually I just solved it. Re-reading my issue made me wonder what a .dylib is anyway and then I found

https://www.nuget.org/packages/Contrib.Grpc.Core.M1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants