Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
1
Question by AAReverse · Mar 07, 2017 at 03:38 PM · freezedebuggerprocess

Unity debugger hangs when using System.Diagnostics.Process

I'm using following code to start process:

 var startInfo = new ProcessStartInfo(executablePath);
 startInfo.WorkingDirectory = Path.GetDirectoryName(executablePath);
 startInfo.FileName = executablePath;
 startInfo.RedirectStandardOutput = true;
 startInfo.RedirectStandardInput = true;
 startInfo.RedirectStandardError = true;
 startInfo.UseShellExecute = false;
 startInfo.Arguments = arguments;
 startInfo.CreateNoWindow = true; 
 
 _process = new Process();
 _process.EnableRaisingEvents = false;
 _process.StartInfo = startInfo;
 _process.OutputDataReceived += _process_OutputDataReceived;
 _process.ErrorDataReceived += _process_ErrorDataReceived;
 _process.Start();
 _process.StandardInput.Close();
 _process.StandardError.Close();
 _process.BeginOutputReadLine();

Everything works fine without a debugger attached. As soon as I attach the visual studio debugger with a breakpoint Unity (and VS) freezes. It only reaches the breakpoint when _process writes something to its standard output.

When I remove _process.BeginOutputReadLine(); then the debugger works correctly. I would like to be able to use visual studio debugger when I debug scripts.

Am I doing something wrong? Or is there some workaround for this?

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image cihadturhan_unity · Mar 13, 2021 at 10:12 PM 0
Share

Too bad there is no answer to this problem. I have the same problem and looking for a solution for hours. I have a little hope but asking here if you remember how you solved this issue. Thanks

avatar image AAReverse cihadturhan_unity · Mar 14, 2021 at 01:19 PM 0
Share

If I remember correctly, the problem was not in the VS but in the process itself. The process was waiting for inco$$anonymous$$g data which, I guess, had blocking behavior. I had to send some data to the process just to keep it alive. I think I ended up constantly sending "DONT_GET_STUCK" string message :D to the process. I'm not really sure though if that was the solution. Just recalled that I did something like that. Hope that helps.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

95 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Editor freezes when starting several System.Diagnostics.Process one after another 0 Answers

Unity permanently locks up when hitting a break point 1 Answer

Unity Editor crashes directx9 or dx11 on windows 10 2 Answers

How to make your program unable to use after one year? 1 Answer

What does frozenDistanceMinMaxThreshold do in the new SteamVR Interaction System 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges