<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dotnet on Matt Thornton</title>
    <link>https://matt-thornton.net/tags/dotnet/</link>
    <description>Recent content in Dotnet on Matt Thornton</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sun, 17 Sep 2017 21:18:29 +0000</lastBuildDate><atom:link href="https://matt-thornton.net/tags/dotnet/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>.NET console app on Mono on Raspberry Pi writing to MySQL (compiled on a Mac)</title>
      <link>https://matt-thornton.net/tech/net-console-app-mono-raspberry-pi-writing-mysql-compiled-mac/</link>
      <pubDate>Sun, 17 Sep 2017 21:18:29 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/net-console-app-mono-raspberry-pi-writing-mysql-compiled-mac/</guid>
      
        <description>&lt;blockquote&gt;
&lt;p&gt;Update: if you&amp;rsquo;re just looking to build a simple LAMP server on a Pi, then there is an updated version of this guide which installs more up to date versions of e.g., PHP, &lt;a href=&#34;https://www.matt-thornton.net/tech/databases/recovering-files-broken-raspberry-pi-part-1&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;For reasons I won&amp;rsquo;t go into, I have an unnecessarily complicated set of requirements:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Dev environment is Windows 10 + Visual Studio 2015 running as a virtual machine inside VMWare Fusion on Max OSX 10.11.6&lt;/li&gt;
&lt;li&gt;Target application is .NET 4.5.2 running on a Raspberry Pi 3 under Mono&lt;/li&gt;
&lt;li&gt;App must write data to MySQL db&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is my first time working with Mono. It&amp;rsquo;s actually relatively straight-forward to setup, but there were one or two hoops I jumped through, so I figure this may be helpful. You could choose to use VSCode on your Mac if you didn&amp;rsquo;t want to go down the Windows dev VM route.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;TL;DR&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The main issue I encountered is the latest MySQL Connector for .NET that you get using NuGET doesn&amp;rsquo;t seem to work in Mono. The trick was to install an early version (&lt;a href=&#34;https://dev.mysql.com/downloads/file/?id=410730&#34;&gt;6.4.6 to be exact&lt;/a&gt;) and once I did this, all seemed to work OK. Have not got much further yet, so not yet sure what other issues I will encounter.&lt;/p&gt;
&lt;p&gt;This assumes you have a completely fresh copy of Raspbian latest. If you haven&amp;rsquo;t, follow a guide &lt;a href=&#34;https://www.raspberrypi.org/documentation/installation/installing-images/README.md&#34;&gt;here&lt;/a&gt;. I used &lt;a href=&#34;https://etcher.io/&#34;&gt;Etcher&lt;/a&gt; for the first time and was very impressed as it worked perfectly.&lt;/p&gt;
&lt;p&gt;I am using the &lt;a href=&#34;https://www.raspberrypi.org/downloads/raspbian/&#34;&gt;-Lite&lt;/a&gt; (no UI) version so may have had to do extra stuff that the full fat version didn&amp;rsquo;t require. I also configured Apache/PHP etc. so I could have phpmyadmin running.&lt;/p&gt;</description>
      
    </item>
    
    <item>
      <title>.NET application output app.config settings at runtime nicely formatted</title>
      <link>https://matt-thornton.net/tech/programming/net-application-output-app-config-settings-runtime-nicely-formatted/</link>
      <pubDate>Tue, 25 Apr 2017 15:29:06 +0000</pubDate>
      
      <guid>https://matt-thornton.net/tech/programming/net-application-output-app-config-settings-runtime-nicely-formatted/</guid>
      
        <description>&lt;p&gt;I&amp;rsquo;m a big fan of .NET console applications. They&amp;rsquo;re a really quick way of getting something functional up and running fast without wasting loads of effort on user interfaces. (Hey, I&amp;rsquo;m a developer, OK&amp;hellip; not a designer. Function over form and all that.)&lt;/p&gt;
&lt;p&gt;I also make heavy use of the built-in app.config / settings functionality so that I can control functionality at runtime. One thing I wanted to do recently was to output the configured settings to the console window so that I could eyeball all was well before going ahead.&lt;/p&gt;</description>
      
    </item>
    
  </channel>
</rss>