Я разрабатываю приложение ASP.NET Wep API, которое использует библиотеку gRPC. В Windows он работает нормально, но если он работает в Linux с Apache и mod_mono, я получаю следующее исключение:
- ChangeConfigurationAsync(): gRPC call failed with exception=[System.IO.FileNotFoundException: Message="Error loading native library. Not found in any of the possible locations: /tmp/apache-temp-aspnet-0/17ae072c/assembly/shadow/bc23f1e5/69f27fa4_d5d18e41_00000001/libgrpc_csharp_ext.x64.so,
/tmp/apache-temp-aspnet-0/17ae072c/assembly/shadow/bc23f1e5/69f27fa4_d5d18e41_00000001/runtimes/linux/native/libgrpc_csharp_ext.x64.so,
/tmp/apache-temp-aspnet-0/17ae072c/assembly/shadow/bc23f1e5/69f27fa4_d5d18e41_00000001/../../runtimes/linux/native/libgrpc_csharp_ext.x64.so"
, StackTrace="
at Grpc.Core.Internal.UnmanagedLibrary.FirstValidLibraryPath (System.String[] libraryPathAlternatives) [0x00042] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.Internal.UnmanagedLibrary..ctor (System.String[] libraryPathAlternatives) [0x00006] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.Internal.NativeExtension.Load () [0x00044] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.Internal.NativeExtension..ctor () [0x00006] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.Internal.NativeExtension.Get () [0x00022] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.Internal.NativeMethods.Get () [0x00000] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.GrpcEnvironment.GrpcNativeInit () [0x00000] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.GrpcEnvironment..ctor () [0x0001e] in <f30adad8041c4e6ba2a109e705aeb795>:0 \n
at Grpc.Core.GrpcEnvironment.AddRef () [0x00028] in <f30adad8041c4e6ba2a109e705aeb795>:0
at Grpc.Core.Channel..ctor (System.String target, Grpc.Core.ChannelCredentials credentials, System.Collections.Generic.IEnumerable`1[T] options) [0x00051] in <f30adad8041c4e6ba2a109e705aeb795>:0
at Grpc.Core.Channel..ctor (System.String host, System.Int32 port, Grpc.Core.ChannelCredentials credentials, System.Collections.Generic.IEnumerable`1[T] options) [0x00012] in <f30adad8041c4e6ba2a109e705aeb795>:0
at MediaGateway.Shared.ConfigurationChangeInterface.Impl.ConfigurationChangeClient+<ChangeConfigurationAsync>d__6.MoveNext () [0x000da] in <208a1a3cb2734ae9bbbbc700fc47e4cd>:0 "] ({})
libgrpc_csharp_ext.x64.so помещается в тот же каталог «bin», что и другие управляемые библиотеки DLL, но, к сожалению, файл .so не копируется в каталоги теневых копий.
- Можно ли отключить теневые копии на mod_mono/Apache?
- Можно ли настроить в Apache/mod_mono, какие файлы должны быть теневыми скопированы в какой каталог?
Насколько я знаю, библиотеку gRPC нельзя настроить для поиска неуправляемых библиотек в других каталогах. У нас также нет проблем с другими нашими демонами mono, которые обычно запускаются с помощью «mono xy.exe» с использованием gRPC.
Мы используем:
- Моноверсия: 5.0.1.1
- Апач/2.4.6
- ЦенОС 7
- гРПЦ 1.2