wpf2023. 6. 7. 15:25

서버야 프로젝트 템플릿이 있어서 그냥 자동으로 만들어지지만

WPF client에서 Protos에 greet.proto를 복사하고 따라했지만 빌드에러가 났다..

 

구글 검색후 해결했다

 

https://stackoverflow.com/questions/60810497/grpc-erros-in-wpf-net-core

 

gRPC erros in WPF .NET Core

I want to create a simple WPF Core, gRPC project. This "code" works perfectly in my .NET Core Console app, however WPF seems to be something special. Proto File syntax = "proto3"...

stackoverflow.com

 

<Project Sdk="Microsoft.NET.Sdk">

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

  <ItemGroup>
    <PackageReference Include="Google.Protobuf" Version="3.23.2" />
    <PackageReference Include="Grpc.Net.Client" Version="2.53.0" />
    <PackageReference Include="Grpc.Tools" Version="2.54.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>
    <Protobuf Include="Protos\greet.proto" GrpcServices="Client" />
    
  </ItemGroup>

</Project>

 

프로젝트 편집에서

 

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

이걸 추가함으로써 빌드가 되었다.

 

 

'wpf' 카테고리의 다른 글

[WPF] 체크박스 xName을 이용하여 반복작업 하지 않고 간결하게  (0) 2023.06.09
MEF란?  (0) 2023.06.08
dynamic property 에서 Set을 할떄  (0) 2022.12.05
public (string name, int age) GetUser()  (0) 2022.10.26
PeriodicTimer  (0) 2022.08.31
Posted by 동동(이재동)