GithubHelp home page GithubHelp logo

Comments (8)

cubed-it avatar cubed-it commented on May 26, 2024 1

I'll try it out and give you feedback later

from messagepack-csharp.

cubed-it avatar cubed-it commented on May 26, 2024

Hey there, I have analyzed my problem a little bit more. The mpc executable hangs in the background and when I end it via task manager, I get an output and the file is created.

I noticed that I have a lot of warnings in the output, e.g:

C:\Program Files\dotnet\sdk\6.0.405\Microsoft.Common.CurrentVersion.targets(2302,5): warning MSB3270: Conflict between the processor architecture of the project "MSIL" being created and the processor architecture of the reference, "Firebase.App", "x86". This conflict can lead to runtime errors. If necessary, use the Configuration Manager to change the processor architecture of your project specified as the target so that the processor architectures are aligned between your project and the references, or select a dependency of references with a processor architecture that corresponds to the processor architecture of your project specified as the target.

Therefore, the assumption was that the bug is related to the output. I therefore changed the code of MessagePackWindow.InvokeProcessStartAsync a little bit to read the output continuously instead of only at the exit. This solved the problem for me. :)

        public static Task<string> InvokeProcessStartAsync(string fileName, string arguments)
        {
            var psi = new ProcessStartInfo() {
                CreateNoWindow = true,
                WindowStyle = ProcessWindowStyle.Hidden,
                StandardOutputEncoding = Encoding.UTF8,
                StandardErrorEncoding = Encoding.UTF8,
                RedirectStandardOutput = true,
                RedirectStandardError = true,
                UseShellExecute = false,
                FileName = fileName,
                Arguments = arguments,
                WorkingDirectory = Application.dataPath
            };

            Process p;
            try {
                p = Process.Start(psi);
            } catch (Exception ex) {
                return Task.FromException<string>(ex);
            }

            var tcs = new TaskCompletionSource<string>();
            p.EnableRaisingEvents = true;
            var data = string.Empty;
            p.OutputDataReceived += (object sender, System.Diagnostics.DataReceivedEventArgs e) => {
                data += Environment.NewLine + e.Data;
            };
            p.BeginOutputReadLine();
            p.Exited += (object sender, System.EventArgs e) => {
                //var data = p.StandardOutput.ReadToEnd();
                p.Dispose();
                p = null;

                tcs.TrySetResult(data);
            };

            return tcs.Task;
        }

from messagepack-csharp.

AArnott avatar AArnott commented on May 26, 2024

mpc isn't particularly interesting any more. Can you try using the 2.6 beta's source generator instead?

from messagepack-csharp.

cubed-it avatar cubed-it commented on May 26, 2024

So I have tried the v2.6.100-alpha package and see no difference. Was this package meant, or where do I have to look?

from messagepack-csharp.

AArnott avatar AArnott commented on May 26, 2024

It's the MessagePack.SourceGenerator package that I'm referring to. Is that what you tried?

from messagepack-csharp.

cubed-it avatar cubed-it commented on May 26, 2024

No I have not tried that nuget. I am trying to start the generation directly from unity. The generation itself is successful, so the generation is not a problem and just working fine. The problem is just that the call of Process.Start does not complete if there is a lot of redirected console output.

from messagepack-csharp.

AArnott avatar AArnott commented on May 26, 2024

I'm not sure what redirected console output has to do with messagepack. And if you haven't tried the source generator yet, I'm not sure what new thing from 2.6 you tried, because we don't ship mpc in 2.6 I'm pretty sure. Merely switching to the 2.6 messagepack.dll itself won't change how codegen works.

from messagepack-csharp.

cubed-it avatar cubed-it commented on May 26, 2024

never mind, thanks for your time

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.