{"id":12978,"date":"2019-04-06T18:06:34","date_gmt":"2019-04-06T16:06:34","guid":{"rendered":"http:\/\/blog.wenzlaff.de\/?p=12978"},"modified":"2019-07-15T20:35:39","modified_gmt":"2019-07-15T18:35:39","slug":"aktuellste-version-mono-auf-dem-raspberry-pi-installieren-fuer-c-programme-visual-c","status":"publish","type":"post","link":"http:\/\/blog.wenzlaff.de\/?p=12978","title":{"rendered":"Aktuellste Version mono auf dem Raspberry Pi installieren f\u00fcr C# Programme (Visual C#)"},"content":{"rendered":"<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono.png\" alt=\"\" width=\"2912\" height=\"1938\" class=\"aligncenter size-full wp-image-12984\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono.png 2912w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono-300x200.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono-768x511.png 768w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/mono-1024x681.png 1024w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Installiert man mono mit <strong>sudo apt install mono-complete<\/strong> ist mono zwar in 30 Minuten installiert, aber nicht in der aktuellsten Version, sondern in Version 4.6.2.<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-12.50.46.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-12.50.46.png\" alt=\"\" width=\"1021\" height=\"283\" class=\"aligncenter size-full wp-image-12979\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-12.50.46.png 1021w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-12.50.46-300x83.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-12.50.46-768x213.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Aktuell ist aber <strong>5.18.1<\/strong> wie auf der <a href=\"https:\/\/www.mono-project.com\/download\/stable\/#download-lin-raspbian\" rel=\"noopener noreferrer\" target=\"_blank\">mono Seite<\/a> zu sehen. Die Installation ist aber auch schnell gemacht, Key, Certificate und Repo laden:<!--more--><\/p>\n<pre class=\"lang:default decode:true \" >\r\n\r\nsudo apt install apt-transport-https dirmngr gnupg ca-certificates\r\nsudo apt-key adv --keyserver hkp:\/\/keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF\r\necho \"deb https:\/\/download.mono-project.com\/repo\/debian stable-raspbianstretch main\" | sudo tee \/etc\/apt\/sources.list.d\/mono-official-stable.list\r\nsudo apt update \r\nsudo apt install mono-complete\r\nsudo apt install ca-certificates-mono\r\n<\/pre>\n<p>Dann ein <strong>mono -V<\/strong> und es wird die aktuellste Version ausgegeben:<\/p>\n<p><a href=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-13.14.51.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-13.14.51.png\" alt=\"\" width=\"976\" height=\"327\" class=\"aligncenter size-full wp-image-12981\" srcset=\"http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-13.14.51.png 976w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-13.14.51-300x101.png 300w, http:\/\/blog.wenzlaff.de\/wp-content\/uploads\/2019\/04\/Bildschirmfoto-2019-04-06-um-13.14.51-768x257.png 768w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<p>Nun noch mal ein kleines Testprogramm compilieren und starten. Dazu erstellen wir die Datei <strong>lande-beispiel.cs<\/strong> mit dem Inhalt:<\/p>\n<pre class=\"lang:default decode:true \" >using System.Net;\r\nusing System;\r\nusing System.IO;\r\n\r\npublic class Downloader\r\n{\r\n    public static void Main (string[] args)\r\n    {\r\n    Console.WriteLine (\"Lade eine Beispiel Datei aus dem Internet ...\");\r\n    WebClient webClient = new WebClient();\r\n    webClient.DownloadFile(\"http:\/\/kleinhirn.eu\/wp-content\/uploads\/2019\/04\/Mind-Map-Uses.png\", @\"beispiel-foto.png\");\r\n    Console.WriteLine (\"Beispielprogramm beendet. Siehe www.wenzlaff.info\");\r\n    }\r\n}<\/pre>\n<p>Das Programm soll nach dem starten nur eine Datei aus dem Internet laden. Dann also die Datei compilieren mit:<\/p>\n<p><strong>mcs lade-beispiel.cs<\/strong> und das Programm mit <strong>mono<\/strong> starten<br \/>\n<strong>mono lade-beispiel.exe<\/strong> so, nun haben wir eine Datei <strong>beispiel-foto.png<\/strong> aus dem Internet mit einem C-Sharp (C#) Progamm geladen.<\/p>\n<p>Oder aber mit <strong>csc lade-beispiel.cs<\/strong> Ausgabe:<br \/>\nMicrosoft (R) Visual C# Compiler version 2.8.2.62916 (2ad4aabc)<br \/>\nCopyright (C) Microsoft Corporation. All rights reserved.<\/p>\n<p>Nun k\u00f6nnen wir noch testen ob die HTTPS Verbindung klappt mit:<br \/>\n<strong><br \/>\ncsharp -e &#8217;new System.Net.WebClient ().DownloadString (&#8222;https:\/\/www.google.de&#8220;)&#8216;<\/strong><\/p>\n<p>Nach ein paar Sekunden, wird die ganze Webseite auf der Konsole ausgegeben.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installiert man mono mit sudo apt install mono-complete ist mono zwar in 30 Minuten installiert, aber nicht in der aktuellsten Version, sondern in Version 4.6.2. Aktuell ist aber 5.18.1 wie auf der mono Seite zu sehen. Die Installation ist aber auch schnell gemacht, Key, Certificate und Repo laden:<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","footnotes":""},"categories":[220,79],"tags":[2741,1379,3596,3598,3597,3599],"class_list":["post-12978","post","type-post","status-publish","format-standard","hentry","category-anleitung","category-programmierung","tag-c","tag-compilieren","tag-csharp","tag-exe","tag-mono","tag-visual-c"],"_links":{"self":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/12978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12978"}],"version-history":[{"count":0,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=\/wp\/v2\/posts\/12978\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12978"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.wenzlaff.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}