Whilst playing with Xamarin I encountered an issue when debugging the Android version of the app. Apparently localhost is not translated causing an error when trying to access an API running on my development machine. Strangely I did not encounter this issue when debugging the IOS version of my app.
To access your localhost (aka your development machine) you need to refer to the IP-address 10.0.2.2.
To work around this issue you can use the DeviceInfo class from Xamarin.Essentials. Just add a statement which checks the type of device the code is being ran on.
string baseAddress = DeviceInfo.Platform == DevicePlatform.Android ? "http://10.0.2.2:25026/file" : "http://localhost:25026/file";