lately I have encountered a following problem. Azure Function that is run in Visual Studio always throws an exception:
System.IO.IOException HResult=0x80131620 Message=Error loading native library "C:\Users\\AppData\Local\AzureFunctionsTools\Releases\2.16.0\cli\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.Server..ctor(IEnumerable`1 options) at Microsoft.Azure.WebJobs.Script.Grpc.GrpcServer..ctor(FunctionRpcBase serviceImpl) in C:\azure-webjobs-sdk-script\src\WebJobs.Script.Grpc\Server\GrpcServer.cs:line 24
The file that is supposedly missing is at its place of course. I've tried to reinstall Azure Function Tools and Visual Studio and nothing helped. Any ideas?
Thanks in advance.
EDIT1:
The problem seems to be caused by non-english characters in the path to the library. I've just created another account without them and suddenly everything started to work.
from the point that the root cause of error is because of the non-english characters in the path to the library, you can consider to rename path of your user profile.
To do so, here is the steps
cmdwmic useraccount get name, sid and get SID of your profileregedit under start menu, right click on it and select Run as AdministratorComputer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\YOUR_SID_HEREProfileImagePath and change the value data according to your need (you can close Registry Editor)%USERPROFILE%\..\) and change the path of your user profile accordinglyUser contributions licensed under CC BY-SA 3.0