基于.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