簡體   English   中英

Xamarin / Mono Mac - AppStore版本中的握手失敗

[英]Xamarin/Mono Mac - Handshake failure in AppStore build

我有一個應用程序,現在需要部署到應用程序商店,因為它由於Gatekeeper而逐漸變得不可避免。

唯一的問題是Web請求似乎失敗了,因為它們甚至沒有被解雇。

以下代碼片段已從Xamarin Bugzilla文章中提取,並在為Release和Debug構建時成功;

            try
            {
                WebClient test = new WebClient();
                Console.WriteLine("Testing SSL GET...");
                string testresponse = test.DownloadString(checkFileUrl);
                Console.WriteLine("testresponse = " + testresponse);
            } catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine(e.InnerException.Message);
            }

但是,當我轉向使用沙盒和網絡IO權利的AppStore構建時,請求永遠不會被發送出去,正如Charles在非SSL解密模式下驗證的那樣。 以下內容從控制台中吐出;

Testing SSL GET...
Error getting response stream (Write: The authentication or decryption has failed.): SendFailure
The authentication or decryption has failed.

這似乎是問題,因為我們使用對IIS服務進行的SOAP調用來執行操作,第一個是登錄。對於Debug和Release,登錄工作正常,因為調用已完成。 再一次,AppStore版本甚至都沒有嘗試聯系。

證書有效,CA安裝在我的鑰匙串中。

在此之前,我在代碼中獲得了一些異常(在Debug中),例如;

System.Exception..ctor (message="invalid encoding specification.") in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System/Exception.cs:81

System.Exception..ctor (message="Store Root doesn't exists.") in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System/Exception.cs:81

System.Exception..ctor (message="Store CA doesn't exists.") in /private/tmp/source/bockbuild-mono-3.2.6/profiles/mono-mac-xamarin/build-root/mono-3.2.6/mcs/class/corlib/System/Exception.cs:81

這仍然讓我相信這是一個證書問題。 測試URL是S3鏈接,登錄服務器是具有有效證書的EC2實例。

干杯。

檢查您的應用程序的打包方式。

默認情況下,在構建項目時(在Xamarin Studio或Visual Studio中),它將調用名為mtouch的工具,該工具包含托管代碼的鏈接器。 此工具用於從應用程序未使用的類庫中刪除功能。

或者mtouch希望你相信。

鏈接器行為的默認選項是Link all assembiles 這將使用mtouch嘗試通過修改用戶代碼使應用程序盡可能小。 這可以並且將破壞以mtouch無法檢測的方式使用功能的代碼(例如web服務,反射或序列化)。

我使用的解決方法是禁用鏈接。 通過將鏈接器行為更改為Don't Link ,這將確保不修改任何程序集。

您可以通過右鍵單擊相關項目並選擇Options來找到要執行此操作的菜單:

Xamarin Studio - 項目選項窗口

特定項目中的鏈接器行為

嘗試將鏈接器行為更改為Don't Link (如上所示)並重建。

更多信息

Xamarin指南 - 與iOS鏈接

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM