GithubHelp home page GithubHelp logo

Comments (5)

SneWs avatar SneWs commented on May 25, 2024 1

Yeah, that's quite understandable... I've been looking at this for a while now as well trying to understand what's going on. It seems that it might be due to a bug in dotnet itself, on later versions of dotnet 8 this is a non-issue. It just won't repro in that case when on dotnet 8.0.200

from messagepack-csharp.

SneWs avatar SneWs commented on May 25, 2024

I'm no windows developer, but fired up a windows box and did some digging, seems that just changing <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> eg adding net8.0 and rebuilding MessagePack.Generator locally and running with --framework net8.0 makes the error go away. Still puzzled over how this works when I run it on Linux and macOS, the main difference there is that I'm in complete control over the environment and ONLY have dotnet 8 SDK installed

So I guess the real solution to this problem in general is to just update MessagePack-CSharp to dotnet 8 and it should not be a problem. And seems that #1725 is on it's way? But perhaps it might be a good? or maybe a really bad? Idea to just update MPC to support net8.0 as it seems only bumping that tool solves at least the issue reported here?

In the meantime, my workaround was to just clone the repo, from master branch build it and then you can either invoke your mpc commands using dotnet run as below, or take the binary and put it in your $PATH somewhere and call your local build instead of the NuGet provided one for now.

dotnet run --project "C:\Dev\Repos\MessagePack-CSharp\src\MessagePack.Generator\MessagePack.Generator.csproj" -i <YOUR_PROJ_FILE> -n <YOUR_NAMESPACE> -o <YOUR_OUTPUT_PATH> --framework net8.0

from messagepack-csharp.

AArnott avatar AArnott commented on May 25, 2024

Thanks for the report and sharing your workaround. I don't know why merely targeting .NET 8 would fix this, but it seems like a bug is present and a .NET 8 target may just be masking it. The repro may be useful.

That said, we're not investing in mpc any more. The next major version will have a roslyn source generator. It's based on a lot of the same code, but a lot is different too, so I don't know whether this bug will repro with it or not.

from messagepack-csharp.

SneWs avatar SneWs commented on May 25, 2024

Alright, good to know.

Would it possible to do a small patch release with just the workaround similar to what I did enabling others that might be upgrading to dotnet8 and happens to be on Windows?

I could do the work needed and submit a PR if it would be an acceptable solution. For my specific use case we can always build and carry our own mpc for the windows folks.

I haven't found any bugs from the generated code we have so far and the code we generate is used quite a lot and using dotnet8 server side and il2cpp client side.

from messagepack-csharp.

AArnott avatar AArnott commented on May 25, 2024

Thank you for offering the PR. However I hesitate to take a PR that makes a problem go away without understanding why it works.

from messagepack-csharp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.