0
Xamarin PCLプロジェクトからアップロードされた画像をAmazon S3コンテナに送信しようとしています。このコードを使用してAndroidとiOSが動作するようにしています。Amazon S3サービスがXamarin PCLプロジェクトのPlugin.Mediaで動作しない
private async void PickPhoto()
{
if (!CrossMedia.Current.IsPickPhotoSupported)
{
await App.Current.MainPage.DisplayAlert("Photos Not Supported", ":(Permission not granted to photos.", "OK");
return;
}
var file = await CrossMedia.Current.PickPhotoAsync();
if (file == null)
return;
this.OrgLogo = ImageSource.FromStream(() =>
{
var stream = file.GetStream();
return stream;
});
try
{
var credentials = new BasicAWSCredentials("xxxxxx", "xxxxxxxx");
var client = new AmazonS3Client(credentials, RegionEndpoint.USEast1);
var transferUtility = new TransferUtility(client);
var filePath = file.Path;
await transferUtility.UploadAsync(
filePath,
"xxx"
);
}
catch (Exception ex)
{
Debug.WriteLine(ex.ToString());
}
}
しかし、以下のような例外を取得:
{System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NotImplementedException: Not implemented in reference assembly.
at PCLCrypto.WinRTCrypto.get_HashAlgorithmProvider() [0x00000] in :0
at Amazon.Runtime.Internal.Util.HashingWrapper.Init (System.String algorithmName) [0x00016] in D:\Jenkins\jobs\v3-stage-release\workspace\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Internal\Util_pcl-sl\HashingWrapper.pcl.cs:42
at Amazon.Runtime.Internal.Util.HashingWrapper..ctor (System.String algorithmName) [0x00019] in D:\Jenkins\jobs\v3-stage-release\workspace\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Internal\Util\HashingWrapper.cs:31
at Amazon.Runtime.Internal.Util.HashingWrapperMD5..ctor() [0x00000] in D:\Jenkins\jobs\v3-stage-release\workspace\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\Internal\Util_pcl-sl\HashingWrapper.pcl.cs:116
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.InternalInvoke (System.Object obj, System.Object[] parameters) [0x00002] in /Users/builder/data/lanes/3540/1cf254db/source/mono/mcs/class/corlib/System.Reflection/MonoMethod.cs:644
誰も私が間違ってやっている私を助けることができますか?