简体   繁体   English

Mono tlstest.exe错误

[英]Mono tlstest.exe error

Setting up Mono for ASP.net app dev on a MacBook Pro El Capitan 10.11.12 i5: tlstest.cs compiles with 3 warnings, and tlstest.exe compiles with 1 error 在MacBook Pro El Capitan 10.11.12 i5上为ASP.net应用程序开发人员设置Mono:tlstest.cs编译时会出现3条警告,而tlstest.exe编译时会出现1条错误

Attempting to run the tests outlined here: 尝试运行此处概述的测​​试:

http://www.mono-project.com/docs/getting-started/mono-basics/ http://www.mono-project.com/docs/getting-started/mono-basics/

mono hello.exe //runs fine with no errors and prints "Hello Mono World"

However, I downloaded tlstest.cs(see link above for source) and compiled it with: 但是,我下载了tlstest.cs(请参阅上面的链接以获取源代码)并使用以下命令进行编译:

mcs tlstest.cs /r:System.dll /r:Mono.Security.dll 

This returned 3 warnings as follows: 这将返回3条警告,如下所示:

tlstest.cs(169,23): warning CS0618: System.Net.ServicePointManager.CertificatePolicy' is obsolete: Use ServerCertificateValidationCallback instead' tlstest.cs(169,23):警告CS0618: System.Net.ServicePointManager.CertificatePolicy' is obsolete:请改用ServerCertificateValidationCallback。

tlstest.cs(210,26): warning CS0618: System.Net.Dns.Resolve(string)' is obsolete: Use GetHostEntry instead' tlstest.cs(210,26):警告CS0618: System.Net.Dns.Resolve(string)' is obsolete:请改用GetHostEntry'

tlstest.cs(176,11): warning CS0219: The variable `prefix' is assigned but its value is never used tlstest.cs(176,11):警告CS0219:已分配变量“前缀”,但从不使用其值

Compilation succeeded - 3 warning(s) 编译成功-3个警告

So now tlstest.exe has been created, so I ran: 所以现在已经创建了tlstest.exe,所以我运行了:

mono tlstest.exe https://www.nuget.org //which returned an error:

Error #-2146762486: CERT_E_CHAINING 0x800B010A 错误#-2146762486:CERT_E_CHAINING 0x800B010A

Had the same error " Error #-2146762486: CERT_E_CHAINING 0x800B010A ". 发生了相同的错误“ 错误#-2146762486:CERT_E_CHAINING 0x800B010A ”。 Followed the FAQ suggested by the link "mono-project.com/docs/faq/security" . 遵循链接“ mono-project.com/docs/faq/security”建议的常见问题解答。 Thanks to Jonathan James 感谢乔纳森·詹姆斯

Executed the command 执行命令

"mozroots --import --ask-remove --machine"

Below results displayed: 显示以下结果:

Mozilla Roots Importer - version 5.14.0.0 Download and import trusted root certificates from Mozilla's MXR. Mozilla Roots Importer-版本5.14.0.0从Mozilla的MXR下载并导入受信任的根证书。 Copyright 2002, 2003 Motus Technologies. 版权所有2002、2003 Motus Technologies。 Copyright 2004-2008 Novell. 版权所有2004-2008 Novell。 BSD licensed. BSD许可。

WARNING: mozroots is deprecated, please move to cert-sync instead. 警告:不建议使用mozroots,请改为使用cert-sync。

Downloading from ' https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt '... WARNING: Downloading the trusted certificate list couldn't be done securely (error: RemoteCertificateChainErrors) 从' https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt '下载...警告:无法下载受信任的证书列表不能安全完成(错误:RemoteCertificateChainErrors)

continuing anyway. 无论如何继续。

If you're using mozroots to bootstrap Mono's trust store on a clean system this might be OK, otherwise it could indicate a network intrusion. 如果您使用mozroots在干净的系统上引导Mono的信任库,则可能没问题,否则可能表明存在网络入侵。 Please ensure you're using a trusted network or move to cert-sync. 请确保您使用的是受信任的网络或转到证书同步。

Importing certificates into machine store. 将证书导入到计算机存储中。 150 new root certificates were added to your trust store. 150个新的根证书已添加到您的信任库中。 Import process completed. 导入过程完成。

Then did the below steps again: 然后再次执行以下步骤:

csc tlstest.cs -r:System.dll <-- 2 warning as before

mono tlstest.exe https://www.nuget.org <--no error shown, only " https://www.nuget.org " is shown. mono tlstest.exe https://www.nuget.org <-没有显示错误,仅显示“ https://www.nuget.org ”。 Hope this helps... 希望这可以帮助...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM