我正在运行一个使用AWSSDK.Core的.NET Core应用程序。但是,我在Mac或Docker linux容器(microsoft/dotnet:1.0.1-sdk-projectjson
)上运行以下代码时遇到异常:
ProfileManager.RegisterProfile(_config.Aws.Credentials.ProfileName, _config.Aws.Credentials.AccessKey, _config.Aws.Credentials.Secret);
以下是例外:
System.DllNotFoundException: Unable to load DLL 'Crypt32.dll': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Amazon.Runtime.Internal.Settings.UserCrypto.CryptProtectData(DATA_BLOB& pDataIn, String szDataDescr, DATA_BLOB& pOptionalEntropy, IntPtr pvReserved, CRYPTPROTECT_PROMPTSTRUCT& pPromptStruct, CryptProtectFlags dwFlags, DATA_BLOB& pDataOut)
at Amazon.Runtime.Internal.Settings.UserCrypto.Encrypt(String unencrypted)
at Amazon.Runtime.Internal.Settings.SettingsCollection.ObjectSettings.WriteToJson(JsonWriter writer)
at Amazon.Runtime.Internal.Settings.SettingsCollection.Persist(StreamWriter writer)
at Amazon.Runtime.Internal.Settings.PersistenceManager.saveSettingsType(String type, SettingsCollection settings)
at Amazon.Util.AWSCredentialsProfile.Persist(String profileName, String accessKeyId, String secretKey)
我的家属如下:
"dependencies": {
"AWSSDK.Core": "3.3.5"
}
答案 0 :(得分:0)
看起来ProfileManager
仅在Windows上受支持。
https://github.com/aws/aws-sdk-net/issues/507#issuecomment-265607037