Those who follow me on Twitter (@markwilsonit) may be aware that I’m attempting to learn some C# skills in my spare time (what little of that I have). It’s not my first foray into coding – I have a Computer Studies degree and, in my youth I wrote code in a variety of languages (BASIC, C, Turbo Pascal, Modula-2, 68000 assembler, COBOL, Visual Basic, C++ and probably some others too) but aside from a little bit of C++ on the Arduino and the odd bit of PowerShell, I haven’t done much in the last 20 years. As my career moves further towards management I’m increasingly convinced it’s technology I enjoy though – and I’m seriously considering a move from infrastructure to software…
Anyway…
I’ve been following a Pluralsight C# course from Scott Allen (@ode2code) and, part way through, Scott uses System.Speech to demonstrate adding references to assemblies. I had a play, adapting something I’d written earlier to talk to me as well as output to the console – nothing grand – just a bit of fun. After showing it to my sons, the eldest (who is 9), described it as “epic” (which I understand is pretty good) and I tweeted, only to be amused by a reply which suggested the same library had caused hilarity in Duncan Smart (@DuncanSmart)’s household:
@markwilsonit Add a reference to System.Speech, mine thought it was hilarious https://t.co/y8CZhw6nQy
— Duncan Smart (@duncansmart) April 25, 2014
Small world, eh!
I followed the link to Duncan’s code and thought “Hmm… GitHub… I use that for my Arduino code… I wonder if…” – and yes, Visual Studio can publish to GitHub too. It took some work to suss it out though, so here’s what I did (following advice on StackOverflow)…
- In Visual Studio, select File then Add to Source Control (which creates a local Git repository)
- On GitHub, create a new reposotory (but don’t initialise it with a README – Visual Studio wants an empty repository.
- Copy the HTTPS URI for the new repo, then go back to Visual Studio, open Team Explorer, select Home then Unsynced Commits and enter the GitHub URL before clicking Publish.
- You may find that you have to commit the changes locally first, which in my case required creating a local username and supplying an email address.
- After committing, the solution should be visible on GitHub.
For reference, I was using Visual Studio Express 2013 for Windows Desktop.