icerpc / icerpc-csharp

A C# RPC framework built for QUIC, with bidirectional streaming, first-class async/await, and Protobuf support.
https://docs.icerpc.dev
Apache License 2.0
94 stars 13 forks source link

More fixes for .NET 9.0 support #3989

Closed bernardnormier closed 1 month ago

bernardnormier commented 1 month ago

The updates to the IceRpc.Protobuf.Tools files are bogus. It's not immediately clear how to do it properly.

pepone commented 1 month ago

The problem is that for the MSBuild tools packages, we have to target netstanard2.0, when we do:

https://github.com/icerpc/icerpc-csharp/blob/81295fb629f5dcf38ee24c7913c84331d206918b/tools/IceRpc.Protobuf.Tools/IceRpc.Protobuf.Tools.csproj#L66-L68

It doesn't find the actual files because the IceRpc.ProtocGen project uses a different target framework (.NET 8 or .NET 9)

I wonder if we can replace $(TargetFramework) with**` like:

<!-- Use the compilers from this source build. -->
      <None Include="../IceRpc.ProtocGen/bin/$(Configuration)/**/*"
            Exclude="../IceRpc.ProtocGen/bin/$(Configuration)/**/*.exe">

A second option would be to not set TargetFramwork directly in IceRpc.Versions.props and use an intermediary variable, that we can use in the non-tools projects to set the target framework.

I can give it a try if you want.

bernardnormier commented 1 month ago

Yes, go ahead!