Well, Arman Kabir was not so clear on HOW this problem is solved for him. After searching on Google Source Code, I figured out what was wrong for me.
If you write this code before you start your service:
Intent vpnServiceIntent = new Intent(Application.Context, typeof(LocalVpnService));
var resolveInfoList = PackageManager.QueryIntentServices(vpnServiceIntent, 0);
Application.Context.StartService(vpnServiceIntent);
And inspect resolveInfoList as follow:
resolveInfoList[0].ServiceInfo.Name // => "md55bfed5bb232464f797409dd275ac40fc.LocalVpnService"
resolveInfoList[0].ServiceInfo.Permission // => (null)
So I got this working when I change my service name in Manifest:
<application android:allowBackup="true" android:icon="@mipmap/icon" android:label="@string/app_name">
<service
android:name="md55bfed5bb232464f797409dd275ac40fc.LocalVpnService"
android:permission="android.permission.BIND_VPN_SERVICE">
<intent-filter>
<action android:name="android.net.VpnService" />
</intent-filter>
</service>
</application>
Maybe this is some Xamarin specificity...
My Service was declared as:
namespace kitkattest
{
[Service]
public class LocalVpnService : VpnService
{
// ...
}
}