首页 > 解决方案 > 为什么当我使用 gPRC 在 .Net Framework(非核心)中获取请求数据时出现运行时错误?

问题描述

我使用 lib Grpc.Core。我的代码:

 var uri = new Uri(url);
 _channel = new Grpc.Core.Channel(uri.Host, uri.Port, Grpc.Core.ChannelCredentials.Insecure);
 _client = new Provider.ProviderClient(_channel);
 //...

当我调用此代码时,我得到一个运行时异常:

无法加载文件或程序集 'netstandard, Version=2.1.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' 或其依赖项之一。该系统找不到指定的文件。”

我的“提供者”是在 .Net 5 上编写的。但是旧项目中的这段代码,我只能使用 .Net Framework。

请帮帮我。

标签: c#.netexceptiongrpcruntimeexception

解决方案


推荐阅读