在Visual Studio中运行Azure函数时无法加载本机库grpc_csharp_ext.x86.dll [英] Failed to load native library grpc_csharp_ext.x86.dll while running Azure Function in Visual Studio

查看:75
本文介绍了在Visual Studio中运行Azure函数时无法加载本机库grpc_csharp_ext.x86.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我遇到了以下问题.在Visual Studio中运行的Azure函数始终会引发异常:

lately I have encountered a following problem. Azure Function that is run in Visual Studio always throws an exception:

System.IO.IOException HResult = 0x80131620消息=加载错误本地图书馆"C:\ Users \\ AppData \ Local \ AzureFunctionsTools \ Releases \ 2.16.0 \ cli \ grpc_csharp_ext.x86.dll"来源= Grpc.Core StackTrace:位于Grpc.Core.Internal.UnmanagedLibrary..ctor(String []libraryPathAlternatives)Grpc.Core.Internal.NativeExtension.LoadUnmanagedLibrary()在Grpc.Core.Internal.NativeExtension.LoadNativeMethods()在Grpc.Core.Internal.NativeExtension..ctor()在Grpc.Core.Internal.NativeExtension.Get()在Grpc.Core.GrpcEnvironment.GrpcNativeInit()在Grpc.Core.GrpcEnvironment..ctor()在位于的Grpc.Core.GrpcEnvironment.AddRef()Grpc.Core.Server..ctor(IEnumerable`1选项)在Microsoft.Azure.WebJobs.Script.Grpc.GrpcServer..ctor(FunctionRpcBaseserviceImpl)中C:\ azure-webjobs-sdk-script \ src \ WebJobs.Script.Grpc \ Server \ GrpcServer.cs:line24

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

理应将丢失的文件放在其位置.我尝试重新安装Azure Function Tools和Visual Studio,但没有任何帮助.有什么想法吗?

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?

谢谢.

该问题似乎是由库路径中的非英文字符引起的.我刚刚创建了一个没有他们的帐户,然后突然一切开始工作.

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

  • 注销并用另一个管理员用户登录到您的PC
  • 通过 CTRL + R 打开命令提示符,然后键入 cmd
  • 键入 wmic用户帐户获取名称,sid 并获取个人资料的 SID
  • 在开始菜单下键入 regedit ,右键单击它,然后选择以管理员身份运行
  • 进入 Computer \ HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows NT \ CurrentVersion \ ProfileList \ YOUR_SID_HERE
  • 双击 ProfileImagePath 并根据需要更改值数据(您可以关闭注册表编辑器)
  • 转到USER PROFILES文件夹(%USERPROFILE%\ .. \ )下,并相应地更改用户配置文件的路径
  • 重新启动计算机
  • Log out and login with another Administrator user to your PC
  • open command prompt by CTRL + R then type cmd
  • type wmic useraccount get name, sid and get SID of your profile
  • type regedit under start menu, right click on it and select Run as Administrator
  • Go under Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\YOUR_SID_HERE
  • Double Click on ProfileImagePath and change the value data according to your need (you can close Registry Editor)
  • go under USER PROFILES folder (%USERPROFILE%\..\) and change the path of your user profile accordingly
  • Restart your computer

这篇关于在Visual Studio中运行Azure函数时无法加载本机库grpc_csharp_ext.x86.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆