oleg-shilo / cs-script

C# scripting platform
http://www.cs-script.net
MIT License
1.57k stars 234 forks source link

Resolve issue in Compile method in class CodeDomEvaluator (Evaluator.CodeDom.cs) #284

Closed TomBruns closed 2 years ago

TomBruns commented 2 years ago

<tl/dbr> Remove extra text from "Contains" statement that breaks the intention

details Currently this method contains the following code (I assume to allow some time for the separate process to startup and start listening on the specified socket/port

       bool buildServerNotRunning() => response.GetLines()
                                                                    .FirstOrDefault()?
                                                                    .Contains("System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (10061)")
                                                                    == true;

I ran into a scenario where my 1st call always failed (see below) but the 2nd one succeeded.

image

The issue is that the number after the exception for me was different then the hardcoded string (10061) in source code

I resolved this by removing that trailing text (10061) in the Contains clause

                            bool buildServerNotRunning() => response.GetLines()
                                                                    .FirstOrDefault()?
                                                                    .Contains("System.Net.Internals.SocketExceptionFactory+ExtendedSocketException")
                                                                    == true;
oleg-shilo commented 2 years ago

Thank you. Fixed. Will be available in the very next release