This Exception happened directly after adding awssdk.s3 nugget package. The application stay on springboard and crash after ~15 sec. If I remove the nugget package, the app work perfectly fine.
Here is the full log of the exception:
[0:] Failed to force load assembly /var/mobile/Containers/Data/Application/BECFD16A-0A5F-4447-9036-0E1D8EEBAA4D/Documents/Memories.iOS.content/AWSSDK.S3.dll. Type:Amazon.S3.AmazonS3Client. Exception: 'No RegionEndpoint or ServiceURL configured'. Callstack: ' at Amazon.Runtime.ClientConfig.Validate () [0x00015] in D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\ClientConfig.cs:538
at Amazon.S3.AmazonS3Config.Validate () [0x00000] in D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Services\S3\Custom\AmazonS3Config.cs:217
at Amazon.Runtime.AmazonServiceClient..ctor (Amazon.Runtime.AWSCredentials credentials, Amazon.Runtime.ClientConfig config) [0x00037] in D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Core\Amazon.Runtime\AmazonServiceClient.cs:153
at Amazon.S3.AmazonS3Client..ctor () [0x00000] in D:\JenkinsWorkspaces\trebuchet-stage-release\AWSDotNetPublic\sdk\src\Services\S3\Generated\_netstandard\AmazonS3Client.cs:65
at (wrapper managed-to-native) System.Reflection.RuntimeConstructorInfo.InternalInvoke(System.Reflection.RuntimeConstructorInfo,object,object[],System.Exception&)
at System.Reflection.RuntimeConstructorInfo.InternalInvoke (System.Object obj, System.Object[] parameters, System.Boolean wrapExceptions) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.Reflection/RuntimeMethodInfo.cs:936 '
I understand the exception but I tried everything that I could find online to give the RegionEndpoint to the application.
What I tried :
- app.config file
- credential in .aws/credentials files
- OS environment variable
- powershell environment variable
- appsettings.Development.json file
- Web.config file
- AWSConfig in the code to set the region
- Changing nugget package version
I don't understand why this package need to have those env. variables set to load the assembly... No code call s3 client yet and the problem happen before the application start.
this is my nugget package list:
<PackageReference Include="AWSSDK.Core" Version="3.7.3.26" />
<PackageReference Include="AWSSDK.CognitoIdentity" Version="3.7.0.86" />
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="3.7.1" />
<PackageReference Include="AWSSDK.S3" Version="3.7.3.19" />
<PackageReference Include="log4net" Version="2.0.12" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.1" />
<PackageReference Include="Microsoft.NETCore.Platforms" Version="5.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Prism.DryIoc.Forms" Version="8.1.97" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.13.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<PackageReference Include="Xamarin.Essentials.Interfaces" Version="1.7.0" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
What I'm trying to do here is just be able to retrieve data in a s3 bucket from a IOS application writtin in visual studio in c sharp with framework netstandard.
Like I said, my application build and work fine on my local device when I don't have the awssdk.s3 package install in the app. When I add the s3 package, the application build but won't pass the springboot.
Step to replicate:
- Create new IOS/Android Xamarin form app
- Add the list of nugget package
- Build the application
- Start the app on local device
Thanks for your help.