Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
GitHub or Developer Community with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
When I trz to run ASP.NET MVC project (CTRL+F5) it ends up with:
Adding applications '/:.'...
Virtual path: /
Physical path: C:\Web\MVCTest\MVCTest
Listening on address: 127.0.0.1
Root directory: C:\Web\MVCTest\MVCTest
Error: System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted.
at System.Net.Sockets.Socket.Bind (System.Net.EndPoint local_end) [0x00065] in C:\cygwin\sources\mono\mcs\class\System\System.Net.Sockets\Socket.cs:1115
at Mono.WebServer.XSPWebSource.CreateSocket () [0x00013] in /tmp/monobuild/build/BUILD/xsp-2.10.2/src/Mono.WebServer.XSP/XSPWebSource.cs:104
at Mono.WebServer.ApplicationServer.Start (Boolean bgThread) [0x00077] in /tmp/monobuild/build/BUILD/xsp-2.10.2/src/Mono.WebServer/ApplicationServer.cs:326
at Mono.WebServer.ApplicationServer.Start (Boolean bgThread, System.Exception initialException) [0x00007] in /tmp/monobuild/build/BUILD/xsp-2.10.2/src/Mono.WebServer/ApplicationServer.cs:306
at (wrapper remoting-invoke-with-check) Mono.WebServer.ApplicationServer:Start (bool,System.Exception)
at Mono.WebServer.XSP.Server.RealMain (System.String args, Boolean root, IApplicationHost ext_apphost, Boolean quiet) [0x00737] in /tmp/monobuild/build/BUILD/xsp-2.10.2/src/Mono.WebServer.XSP/main.cs:467
The application exited with code: 1
I need to go to Project options->XSP Web Server and change port number to different one. After some time I end up with several mono.exe processes (most likely XSP4 processes that run and block the ports). I need to kill them in order to free the ports.
Why there is no automatic ending of the running web app?
There is. When you hit "stop", we kill the running xsp instance. This works fine for me with the .NET runtime. Does this only happen with the Mono runtime? Do you have a native debugger you could use to inspect the hung Mono processes?
It happens when I run the web app in debug mode (F5) but actually the debugger doesn't start and nothing happens even the button has changed from 'play' to 'stop'. Then I stop debugging mode by pressing the 'stop' button and the mono.exe process stays running.
Command line of the process is:
"C:\PROGRA~2\MONO-3~2.3\bin\mono.exe" "C:\PROGRA~2\MONO-3~2.3\lib\mono\4.0\winhack\xsp4.exe" --port 80 --address 127.0.0.1 --nonstop --verbose --nonstop
So it looks like it doesn't hang but lost the handle. It might be connected with previously reported bug 20801.
Sorry, previously reported bug is 20800.
Why here is not possible to edit the posts?
So I think the debugging basically doesn't work and it causes that XS doesn't stop running xsp4.exe. I mean by "doesn't work' that it doesn't run the debugger, doesn't stop on break points, doesn't show page in the browser. Only an empty application output window is shown and the play button is changed to stop button. After stopping it, basically nothing happen. It hides the output window and get back to normal state leaving the process running.
If the mono process stays running when we try to end it, that sounds like a runtime bug.
FWIW, Mono on Windows isn't well supported, I suggest you use .NET.
What do you mean by that? Shouldn't I use Xamarin Studio?
I use Microsoft.NET runtime in XS. I have it selected:
Tools->Options->.NET Runtimes->Microsoft .NET (Default)
When I try to debug the web app (pressing F5), it executes cmd line I've sent in the post from 2014-06-23 14:23:24 and stays running.
Only way I can work is to kill the mono.exe process and continue developing and running the web app without debug (ctrl+F5). if the xsp is running in that case it shows me a dialog saying "An application is already running. Do you want to stop it?". And I need to click the 'Stop' button again and again, but it is the another story.
Created attachment 7165 [details]
What happens after running the asp.net web app from XS in debug mode
I added screenshot showing what happens when I press F5 in XS (=executing asp.net web app in debug mode).
My comment is placed directly in the picture. When I stop debug mode, the mono.exe process is still running. I am not able to run the web app again without debug mode because the mono.exe (xsp4) block the port, so I would end up with the message I've sent in the first post.
Hope now it is understandable.
That's definitely using the Mono runtime, not the .NET runtime. Check the Project-> Active Runtime menu, maybe you've set a different runtime for the project
Created attachment 7180 [details]
XS project runtime
It is really .Net Runtime. Check the enclosed picture.
Can you still reproduce that with latest version of mono? If you still can, please reopen and provide a repro case. Thank you