首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用.NET Core和的

使用.NET Core和的
EN

Stack Overflow用户
提问于 2017-03-11 13:34:26
回答 2查看 525关注 0票数 1

我正在编写使用C#运行时(.NET Core)的AWS函数的Alexa技能,并试图使用它们的API连接到Google。它在运行时抛出一个缺失的DLL异常:

“System.Security.Cryptography.CngKeyLite”的类型初始化程序引发了一个异常。 在System.Security.Cryptography.CngKeyLite.ImportKeyBlob(String blobType,Byte[] keyBlob) 在System.Security.Cryptography.RSAImplementation.RSACng.ImportKeyBlob(Byte[] rsaBlob,布尔includePrivate) 在System.Security.Cryptography.RSAImplementation.RSACng.ImportParameters(RSAParameters参数处) 在Google.Apis.Auth.OAuth2.ServiceAccountCredential.Initializer.FromPrivateKey(String privateKey) 在Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateServiceAccountCredentialFromParameters(JsonCredentialParameters credentialParameters) 在Google.Apis.Auth.OAuth2.DefaultCredentialProvider.CreateDefaultCredentialFromParameters(JsonCredentialParameters credentialParameters) 在AlexaProjLib.GoogleSheet.Connect() 在AlexaProj.Function.FunctionHandler(SkillRequest输入,ILambdaContext上下文)

内部例外:

无法加载DLL 'ncrypt.dll':找不到指定的模块。

代码:

代码语言:javascript
复制
var credential = GoogleCredential.FromJson(_googleSecret).CreateScoped(_scopes);

Service = new SheetsService(new BaseClientService.Initializer()
{
    HttpClientInitializer = credential,
    ApplicationName = _applicationName,
});

我是.NET核心和Lambda的新手--如何正确引用缺失的DLL?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2017-03-18 13:14:36

问题是我在project.json文件(win10-x64)中定义了一个Windows运行时,这导致了这些运行时错误(AWS在Amazon上运行)。最后通过使用dotnet lambda包编译并运行它,并提供了更多详细信息这里

票数 0
EN

Stack Overflow用户

发布于 2017-03-12 01:27:12

尝试遵循这个github论坛中提供的说明,因为其他用户也会遇到它。

代码语言:javascript
复制
execute
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/

instead of
ln -s /usr/local/Cellar/openssl/1.0.2h_1/lib/libcrypto.1.0.0.dylib /usr/local/lib
ln -s /usr/local/Cellar/openssl/1.0.2h_1/lib/libssl.1.0.0.dylib /usr/local/lib

if you receive "File exists" message ln -sf will do the magic..

ln -sf /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -sf /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42735829

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档