Home>
I want to achieve

I want to create a function to save the file downloaded by HTTPClient on the external storage, but it does not work with the release build version.
I am developing with xamarin of VisualStudio2019, and I was able to confirm that it can operate normally with the debug build version.

However, when I try to run the release build version, is it not authorized? Will result in an error.
The authority to access the external storage must be Granted
I have confirmed it.

Is there any permission acquisition process required in the release build version?
(Do you need permissions other than storage?)

I got stuck in try-catch at httpClient.GetAsync and the Message is "Permission.denied"

Corresponding source code
try
{
    using (var httpClient = new HttpClient ())
    {
        var res = await httpClient.GetAsync (url, HttpCompletionOption.ResponseHeadersRead);
        if ((int) res.StatusCode>= 400)
        {
            // Download failed
            return;
        }
        else else
        {
            // Save the download file (fileStream)
        }
    }
catch (Exception ex)
{
// Download failed
// If i check ex.Message here, it will be "Permission.denied"
Return;
}
What I tried

Check ReadExternalStorage and WriteExternalStorage of the storage,
Confirm that it is "Granted"
Normal end in debug build version
On the same program, read/write XML files on external storage works fine with release build version

Supplementary information

Target is Android 7.0
Developed by Visual Studio 2019 xamarin