icerpc-csharp icon indicating copy to clipboard operation
icerpc-csharp copied to clipboard

More fixes for .NET 9.0 support

Open bernardnormier opened this issue 1 year ago • 1 comments

bernardnormier avatar May 22 '24 00:05 bernardnormier

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

bernardnormier avatar May 22 '24 01:05 bernardnormier

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.

pepone avatar May 22 '24 16:05 pepone

Yes, go ahead!

bernardnormier avatar May 22 '24 18:05 bernardnormier