首页 > 其他分享 >【gRPC】.NET 6 WPF gRPC client 无法找到命名空间生成项目失败

【gRPC】.NET 6 WPF gRPC client 无法找到命名空间生成项目失败

时间:2023-02-01 23:35:34浏览次数:68  
标签:gRPC csproj AutoAnalysisSystemClientTest 生成 client NET WPF

基于.NET 6的WPF项目作为gRPC客户端,生成项目时出错:

1>D:\projects\aasp_pc_soft\AutonomicAnalysisSystemForPressurePellets\AutoAnalysisSystemClientTest\AutoAnalysisSystemClientTest\MainWindow.xaml.cs(1,7,1,31): error CS0246: 未能找到类型或命名空间名“AutoAnalysisSystemServer”(是否缺少 using 指令或程序集引用?)
1>已完成生成项目“AutoAnalysisSystemClientTest_lobubfhn_wpftmp.csproj”的操作 - 失败。

 

解决方法:

c# - gRPC erros in WPF .NET Core - Stack Overflow

 


Add this line in WPF Project File, file with extension "*.csproj", specifically in the tag <PropertyGroup> and rebuild:

<CoreCompileDependsOn>$(CoreCompileDependsOn);Protobuf_Compile</CoreCompileDependsOn>

It will look like this in the .csproj file:

"..."
    <PropertyGroup>
        <OutputType>WinExe</OutputType>
        <TargetFramework>net6.0-windows</TargetFramework>
        <Nullable>enable</Nullable>
        <UseWPF>true</UseWPF>
        <CoreCompileDependsOn>$(CoreCompileDependsOn);Protobuf_Compile</CoreCompileDependsOn>
      </PropertyGroup>
"..."

 

标签:gRPC,csproj,AutoAnalysisSystemClientTest,生成,client,NET,WPF
From: https://www.cnblogs.com/144823836yj/p/17084496.html

相关文章

  • hrnet读取coco数据集
     train.py里make_dataloader读取数据集。train_loader=make_dataloader(cfg,is_train=True,distributed=args.distributed)datasetbuild.py中的39行dataset=e......
  • ASP.NET Core 6.0 基于模型验证的数据验证
    https://zhuanlan.zhihu.com/p/551581094 1.1、数据验证的场景比较传统的验证方式如下:publicstringTraditionValidation(TestModelmodel){if(string.IsNul......
  • HttpClient 正确使用方法
    如何正确模拟 Http请求,建议使用HttpClient 错误用法   varhttpClient=newHttpClient(); 正确用法ServiceCollection.AddHttpClient();publicc......
  • 【Retail】Postman支持调试Grpc
    官方文档https://learning.postman.com/docs/sending-requests/grpc/using-service-definition/新建Grpc请求将probo文件上传postmanbiz/controller/purchase_order_c......
  • .NET 入门到高级路线
    .NET入门到高级路线[c#基础语法](#CSharp基础语法)[.NETCore基础知识](#.NETCore基础知识)[ASP.NETCore基础知识概述](#ASP.NETCore基础知识概述)[Bla......
  • 【Postman】升级后恢复原有数据 + grpc
    Mac安装路径/Users/xx.ding/Library/ApplicationSupport/Postman升级后备份collection在安装路径下grpchttps://learning.postman.com/docs/sending-requests/grpc/......
  • json .net 反序列化
    引用链接https://www.cnblogs.com/nice0e3/p/15294585.html#%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96%E6%94%BB%E5%87%BBhttps://www.anquanke.com/post/id/172920#h3-3j......
  • [42S01] [Microsoft][SQL Server Native Client 11.0][SQL Server]数据库中已存在名为
    SQL server 下图中两个红色的地方不能保持一样,否则就会出现上面的错误 在 CONSTRAINT的后面表名中加上一些标识便可 (例_PK)与上面创建的表名区分开就可以了......
  • Kubernetes搭建Yearning与简单使用
    背景:数据库基本为myql,数量不是很多,过去一直默认开启了防火墙模式通过公司固定IP,远程访问操作mysql。疫情原因,一些小伙伴不喜欢远程通过公司的网络去连接mysql,频繁添加防......
  • Net6/SuperSocket通过命令和命令过滤器实现服务端/客户端双工通信
    十年河东,十年河西,莫欺少年穷学无止境,精益求精和上一节一致,通信数据结构如下:///+-------+---+-------------------------------+///|request|l|......