<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> System;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> System.Collections.Generic;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: rgb(4, 51, 255);" class="">using</span> System.Text;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> System.Threading.Tasks;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> Amazon.SQS.Model;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> Amazon.SQS;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: rgb(4, 51, 255);" class="">using</span> System.Diagnostics;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> System.Threading;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> <a href="http://System.Net" class="">System.Net</a>;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">using</span> System.Security.Cryptography.X509Certificates;</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New'; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><span style="color: #0433ff" class="">namespace</span> TestApp</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">{</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New'; color: rgb(51, 162, 189);" class=""><span style="color: #000000" class="">    </span><span style="color: #0433ff" class="">class</span><span style="color: #000000" class=""> </span>Program</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">    {</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">        <span style="color: #0433ff" class="">static</span> <span style="color: #0433ff" class="">int</span> Main(<span style="color: #0433ff" class="">string</span>[] args)</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">        {</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New'; color: rgb(180, 38, 26);" class=""><span style="color: #000000" class="">            </span><span style="color: #33a2bd" class="">QueueTest</span><span style="color: #000000" class=""> qt = </span><span style="color: #0433ff" class="">new</span><span style="color: #000000" class=""> </span><span style="color: #33a2bd" class="">QueueTest</span><span style="color: #000000" class="">(</span>“YOUR_ACCESS_KEY"<span style="color: #000000" class="">, </span>“YOUR_SECRET_KEY"<span style="color: #000000" class="">, </span>“YOUR_QUEUE_URL"<span style="color: #000000" class="">);</span></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">            <span style="color: #0433ff" class="">while</span> (<span style="color: #0433ff" class="">true</span>)</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">            {</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">                qt.getMessages();</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">                <span style="color: #33a2bd" class="">Thread</span>.Sleep(100);</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">            }</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">         }</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">     }</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><div style="margin: 0px; line-height: normal; color: rgb(4, 51, 255);" class="">    internal<span style="color: #000000" class=""> </span>class<span style="color: #000000" class=""> </span><span style="color: #33a2bd" class="">QueueTest</span></div><div style="margin: 0px; line-height: normal;" class="">    {</div><div style="margin: 0px; line-height: normal;" class="">        <span style="color: #0433ff" class="">private</span> <span style="color: #0433ff" class="">string</span> QueueUrl;</div><div style="margin: 0px; line-height: normal;" class="">        <span style="color: #0433ff" class="">private</span> <span style="color: #0433ff" class="">string</span> AccessKey;</div><div style="margin: 0px; line-height: normal;" class="">        <span style="color: #0433ff" class="">private</span> <span style="color: #0433ff" class="">string</span> SecretKey;</div><div style="margin: 0px; line-height: normal;" class="">        <span style="color: #0433ff" class="">public</span> QueueTest(<span style="color: #0433ff" class="">string</span> AccessKey, <span style="color: #0433ff" class="">string</span> SecretKey, <span style="color: #0433ff" class="">string</span> queueUrl)</div><div style="margin: 0px; line-height: normal;" class="">        {</div><div style="margin: 0px; line-height: normal;" class="">            <span style="color: #0433ff" class="">this</span>.AccessKey = AccessKey;</div><div style="margin: 0px; line-height: normal;" class="">            <span style="color: #0433ff" class="">this</span>.SecretKey = SecretKey;</div><div style="margin: 0px; line-height: normal;" class="">            <span style="color: #0433ff" class="">this</span>.QueueUrl = queueUrl;</div><div style="margin: 0px; line-height: normal;" class="">        }</div><div style="margin: 0px; line-height: normal; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">        <span style="color: #0433ff" class="">public</span> <span style="color: #0433ff" class="">void</span> getMessages()</div><div style="margin: 0px; line-height: normal;" class="">        {</div><div style="margin: 0px; line-height: normal;" class="">            <span style="color: #0433ff" class="">using</span> (<span style="color: #33a2bd" class="">AmazonSQSClient</span> sqsClient = <span style="color: #0433ff" class="">new</span> <span style="color: #33a2bd" class="">AmazonSQSClient</span>(AccessKey, SecretKey, Amazon.<span style="color: #33a2bd" class="">RegionEndpoint</span>.USEast1))</div><div style="margin: 0px; line-height: normal;" class="">            {</div><div style="margin: 0px; line-height: normal; color: rgb(51, 162, 189);" class=""><span style="color: #000000" class="">                </span>ReceiveMessageRequest<span style="color: #000000" class=""> rm = </span><span style="color: #0433ff" class="">new</span><span style="color: #000000" class=""> </span>ReceiveMessageRequest<span style="color: #000000" class="">();</span></div><div style="margin: 0px; line-height: normal; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">                rm.MaxNumberOfMessages = 10;</div><div style="margin: 0px; line-height: normal;" class="">                rm.QueueUrl = QueueUrl;</div><div style="margin: 0px; line-height: normal;" class="">                rm.WaitTimeSeconds = 10;</div><div style="margin: 0px; line-height: normal;" class="">                rm.VisibilityTimeout = 300;</div><div style="margin: 0px; line-height: normal; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">                <span style="color: #33a2bd" class="">ReceiveMessageResponse</span> rsp = sqsClient.ReceiveMessage(rm);</div><div style="margin: 0px; line-height: normal; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">                <span style="color: #0433ff" class="">if</span> (rsp.Messages.Count > 0)</div><div style="margin: 0px; line-height: normal;" class="">                {</div><div style="margin: 0px; line-height: normal;" class="">                    <span style="color: #0433ff" class="">foreach</span> (<span style="color: #33a2bd" class="">Message</span> m <span style="color: #0433ff" class="">in</span> rsp.Messages)</div><div style="margin: 0px; line-height: normal;" class="">                    {</div><div style="margin: 0px; line-height: normal;" class="">                        <span style="color: #33a2bd" class="">Console</span>.WriteLine(m.Body);</div><div style="margin: 0px; line-height: normal;" class="">                    }</div><div style="margin: 0px; line-height: normal;" class="">                }</div><div style="margin: 0px; line-height: normal; min-height: 11px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">            }</div><div style="margin: 0px; line-height: normal;" class="">        }</div><div style="margin: 0px; line-height: normal;" class="">    }</div></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><br class=""></div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class="">}</div><div style="margin: 0px; font-size: 9.5px; line-height: normal; font-family: 'Courier New';" class=""><br class=""></div><div><blockquote type="cite" class=""><div class="">On Nov 22, 2016, at 10:42 AM, Juan Cristóbal Olivares <<a href="mailto:cristobal@cxsoftware.com" class="">cristobal@cxsoftware.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">James:<div class=""><br class=""></div><div class="">Do you have any code sample so it can be debugged? Thanks</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Nov 22, 2016 at 10:26 AM, <a href="http://james.wheeler.pe/" class="">james.wheeler.pe</a> <span dir="ltr" class=""><<a href="mailto:james.wheeler.pe@gmail.com" target="_blank" class="">james.wheeler.pe@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thought I posted this yesterday but can't find it.<br class="">
<br class="">
Forgive me if it shows up twice.<br class="">
<br class="">
We have a lot of C# code that we would like to run under Amazon Lambda.<br class="">
<br class="">
Mono would seem to be the most effective way to achieve this.<br class="">
<br class="">
I have been able to get simple applications to run but things fail<br class="">
when I try to use libraries that ultimately make a call via WebRequest.<br class="">
<br class="">
Here is a partial stack trace....<br class="">
<br class="">
libc :   at (wrapper managed-to-native) System.Platform:uname (intptr)<br class="">
  at System.Platform.CheckOS () [0x00022] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at System.Platform.get_IsMacOS () [0x0000a] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.WebRequest.<wbr class="">GetSystemWebProxy () [0x00149] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.WebRequest.<wbr class="">GetDefaultWebProxy () [0x0003f] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.WebRequest.get_<wbr class="">DefaultWebProxy () [0x00024] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.<wbr class="">GlobalProxySelection.get_<wbr class="">Select () [0x00000] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.HttpWebRequest..<wbr class="">ctor (System.Uri uri) [0x0008d] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at (wrapper remoting-invoke-with-check) <a href="http://System.Net" class="">System.Net</a>.HttpWebRequest:.<wbr class="">ctor<br class="">
(System.Uri)<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.HttpRequestCreator.<wbr class="">Create (System.Uri uri) [0x00000] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at <a href="http://System.Net" class="">System.Net</a>.WebRequest.Create (System.Uri requestUri) [0x00022] in<br class="">
<<wbr class="">bd46d4d4f7964dfa9beea098499ab5<wbr class="">97>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">HttpRequest..ctor (System.Uri requestUri)<br class="">
[0x00006] in <<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">HttpWebRequestFactory.<wbr class="">CreateHttpRequest<br class="">
(System.Uri requestUri) [0x00000] in <5fa4eac2df714f<br class="">
aba4a923294bf63545>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">HttpHandler`1[TRequestContent]<wbr class="">.CreateWebRequest<br class="">
(Amazon.Runtime.<wbr class="">IRequestContext requestConte<br class="">
xt) [0x0000e] in <<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">HttpHandler`1[TRequestContent]<wbr class="">.InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext<br class="">
) [0x00020] in <<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">PipelineHandler.InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext) [0x0000e] in<br class="">
<<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">Unmarshaller.InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext) [0x00000] in <5f<br class="">
a4eac2df714faba4a923294bf63545<wbr class="">>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">PipelineHandler.InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext) [0x0000e] in<br class="">
<<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
  at Amazon.SQS.Internal.<wbr class="">ValidationResponseHandler.<wbr class="">InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext) [0x0000<br class="">
0] in <<wbr class="">77e6e07db95447a7b69000e72919ce<wbr class="">ce>:0<br class="">
  at Amazon.Runtime.Internal.<wbr class="">PipelineHandler.InvokeSync<br class="">
(Amazon.Runtime.<wbr class="">IExecutionContext executionContext) [0x0000e] in<br class="">
<<wbr class="">5fa4eac2df714faba4a923294bf635<wbr class="">45>:0<br class="">
<br class="">
On the machine I used to create the package to deploy to Amazon Lambda I<br class="">
have mono installed and on this machine all the applications work<br class="">
flawlessly.<br class="">
<br class="">
Installing mono for Amazon Lambda is not an option.<br class="">
<br class="">
I used mkbundle --deps .... to build the package to deploy to Amazon Lambda.<br class="">
<br class="">
For a while I suspected that the issue might be due to a missing or empty<br class="">
mono certificate store.  However I implemented the ICertificatePolicy<br class="">
interface and accepted everything and that has no affect.<br class="">
<br class="">
I'd really like to get this working because Amazon Lambda has many practical<br class="">
benefits.<br class="">
<br class="">
Any help or suggestions would be greatly appreciated.<br class="">
<br class="">
Also, and don't know if this is related or relevant, but I cannot get the<br class="">
--static flag to work with mkbundle.  The link stage always fails saying it<br class="">
cannot find -lmono-2.0.<br class="">
<br class="">
<br class="">
<br class="">
--<br class="">
View this message in context: <a href="http://mono.1490590.n4.nabble.com/Amazon-Lambda-With-Mono-tp4669222.html" rel="noreferrer" target="_blank" class="">http://mono.1490590.n4.nabble.<wbr class="">com/Amazon-Lambda-With-Mono-<wbr class="">tp4669222.html</a><br class="">
Sent from the Mono - Dev mailing list archive at <a href="http://Nabble.com" class="">Nabble.com</a>.<br class="">
______________________________<wbr class="">_________________<br class="">
Mono-devel-list mailing list<br class="">
<a href="mailto:Mono-devel-list@lists.dot.net" class="">Mono-devel-list@lists.dot.net</a><br class="">
<a href="http://lists.dot.net/mailman/listinfo/mono-devel-list" rel="noreferrer" target="_blank" class="">http://lists.dot.net/mailman/<wbr class="">listinfo/mono-devel-list</a><br class="">
</blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><font face="arial, helvetica, sans-serif" class=""><div class=""><font face="arial, helvetica, sans-serif" class=""><span style="font-family:arial" class=""><font face="arial, helvetica, sans-serif" class=""><font color="#333333" class="">Atte,</font></font><font color="#333333" class=""><br class=""><font face="arial, helvetica, sans-serif" class="">Juan Cristóbal Olivares</font></font></span><br class=""></font></div><br class=""></font><div class=""><font face="arial, helvetica, sans-serif" class=""><img src="http://cxsoftware.com/firma2.png" class=""> </font></div><div class=""><span style="font-family:arial,helvetica,sans-serif" class=""><b class=""><a href="http://www.cxsoftware.com/" style="text-decoration:none" target="_blank" class=""><font color="#000099" class="">cxsoftware.com</font></a></b></span></div><div class=""><span style="font-size:x-small" class=""><font face="arial, helvetica, sans-serif" class="">Skype:</font></span><b class=""><span style="font-size:x-small" class=""><font face="arial, helvetica, sans-serif" class=""> </font></span></b><span style="font-size:x-small" class=""><font face="arial, helvetica, sans-serif" class="">juancriolivares<br class=""></font></span><div class=""><span style="font-size:x-small;text-decoration:none" class=""><table border="0" cellpadding="0" cellspacing="0" class=""><tbody class=""><tr class=""><td class="">Celular: +56-9 9871 7277<br class=""><br class=""><br class=""></td></tr><tr class=""><td class=""><span style="font-size:x-small;text-decoration:none" class=""><font face="arial, helvetica, sans-serif" class=""><font style="text-decoration:none" class=""><font color="#000099" class=""> </font></font></font></span></td></tr></tbody></table></span></div></div></div></div></div></div>
</div>
</div></blockquote></div><br class=""></body></html>