Cassini Dev always runs with same port number (32768) regardless of /p switch

Apr 27, 2012 at 8:29 PM
I downloaded the source and traced this to the ComandLineArguments.Validate method (line 362 in MiscCommandLineParser.cs)... 
Port = CassiniNetworkUtils.GetAvailablePort(PortRangeStart, PortRangeEnd,
                                            System.Net.IPAddress.Parse(IPAddress), true);
I'm going to assume that this was accidently left it for debugging?
Coordinator
Jun 11, 2012 at 12:35 PM

that assignment is done when using /PortMode:FirstAvailable (the default)

 

if you would like to specify port you should use /PortMode:Specific /Port:8088

Jun 11, 2012 at 9:29 PM
Edited Jun 11, 2012 at 9:29 PM

Hmmm, I see.  My problem was with doing the visual studio drop in replacement.  The following section just above the line in question might be failing:

            if (VisualStudio) // then STOP HERE.
            {
                // It is fortunate that in order to provide api parity with WebDev
                // we do not need to port scan. Visual Studio balks and refuses to 
                // attach if we monkey around and open ports.
                Port = Port == 0 ? 80 : Port;
                PortMode = PortMode.Specific;
                return;
            }

Maybe a case sensitivity problem (guessing at this point)? Use Invariant instead?

//program.cs, line 48
                bool isVS = Assembly.GetExecutingAssembly()
                    .GetName().Name.StartsWith("WEBDEV.WEBSERVER", StringComparison.OrdinalIgnoreCase);
Coordinator
Jul 14, 2012 at 5:50 PM

thank you. it looks like i took your advice sometime ago. ;-)