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
아무도 내가 잘못 한 일을 좀 도와 줄래?