I believe this is a regression because I haven't seen this behaviour in previous versions of VisualStudio for Mac (now using 8.2.4; not sure the exact version when this started happening, possibly when Mono 6.0 was bundled).
Steps to reproduce:
- Open VS4Mac, create new project/solution, Console type, language: C#.
- Use this simple snippet:
using System;
using System.Linq;
using System.Collections.Generic;
using System.Net.Sockets;
using System.Threading.Tasks;
namespace TestResolveCSharpConsole
{
class MainClass
{
public static void Main(string[] args)
{
try
{
var results = ResolveAsync().GetAwaiter().GetResult();
}
catch (SocketException sockEx)
{
Console.WriteLine("correctly handled");
}
}
public static async Task<List<string>> ResolveAsync()
{
var addresses = await System.Net.Dns.GetHostAddressesAsync("foo.bar.baz");
return new List<string>(addresses.Select(addr => addr.ToString()));
}
}
}
- Compile it. (If you run it outside VS4Mac, result should just be the printing of the string "correctly handled".)
- Run it with the debugger inside VS4Mac.
Expected results:
Should just run it and not stop, finish execution at the end like it's the case when being run outside of VS4Mac.
Current results:
Debugger seems to bomb when a SocketException is thrown, even if it's properly handled with a try-catch (this is the first bug). Then it tries to open the source code of the BCL where this exception happened (Dns.cs), telling the weird error "Source Not Found" to the user.
See screenshot:

VS bug #973786, VS bug #989287