Making MonoDevelop for Mac (or Xamarin Studio) more like Visual Studio
If I were only living in the land of MonoDevelop, I probably wouldn’t care. I stil spend a large amount of time using Visual Studio, though, and switching contexts becomes very difficult when the IDEs are so different. While I haven’t gone as far as to swap the command and alt keys to match keyboard behavior on Windows, I do try to unite things as much as possible.
If you are simply looking for a list of the default MonoDevelop keyboard shortcuts to learn, check out something more like this post from Dan Quirk.
MonoTouch Programming in Visual Studio
TL;DR
Never underestimate the little time sinks of switching between IDEs regularly. To write MonoTouch code in Visual Studio 2010 (debug/deploy still requires MonoDevelop on a Mac), go get VSMonoTouch. If you have any issues getting it going, you may need to toss in some project file tweaks.
- Set it to not reference mscorlib.dll
- Set the
System.Web.Services
reference to version 2.0.5.0 (and likely any others that may conflict with the latest .NET runtime assemblies).
Creating an animated spinner in a Xamarin.iOS (MonoTouch) UIImageView
Background
I’m well into my first week of building the Sierra Trading Post first iOS app using Xamarin.iOS and it has been a fun ride so far. One of the first things needed was a system for showing a loading image while asynchronously retrieving the final image with a web request.
Mono for Android: "aapt.exe" exited with code 1
TL;DR
Also available in TL;SO (too long; Stack Overflow) flavor.
Getting this error:
"aapt.exe" exited with code 1
?Do you have any files in your Mono for Android solution that are being packaged together with the app (e.g., “AndroidResource” build action)?
If so, make sure they don’t have anything but letters, numbers, periods, and underscores ([a-z0-9_.]) in their names.
Where did that JSON field go? Serializing IHtmlString to JSON
TL;DR
If your brain consumes Stack Overflow questions better than blog posts, go see “How do I serialize IHtmlString to JSON with Json.NET?” over there.
Performance Stub: getting all subtype items from a list
Performance Stubs
These blog posts are simply times I wanted to identify the fastest method for accomplishing a particular goal. As I write the code, I like to make some light notes of alternatives while driving forward with the first implementation that makes it from my brain to my fingers.
When I get the chance, I can go back and flesh out the two versions and drop them into some basic
Stopwatch
timing to determine which is better in terms of raw speed. Factoring those results with clarity of code, I have a method I will likely choose the next time I need the same feature.Goal
Given a particular
IEnumerable
, find all the elements that are of a particular type (subclass, in this case).Closing and Re-opening tabs in Visual Studio with Ctrl+W
Visual Studio 2017 Undo-Close Update: The Productivity Power Tools have spun off into a bunch of more-focused extensions. To get Undo Close in Visual Studio 2017, you will want the Power Commands extension now.
Visual Studio 2013 Undo-Close Update: Since the prior options for re-opening closed tabs fell apart with the release of Visual Studio 2013, you will need the newly released Productivity Power Tools 2013.
Update: now with the ability to re-open closed tabs with Ctrl+Shift+T. This also allows you to re-open tabs closed by a project file reload, which is fantastic!
Ever tried to close a tab in Visual Studio 2010/2012 with Ctrl+W. If so, you find yourself selecting the current word in your text editor (Edit.SelectCurrentWord). I don’t use that shortcut, though I could see it being handy over my usual Ctrl+Shift+Right-/Left-Arrow. I do, however, use Ctrl+W to close windows/tabs in just about every other program I use. In order to make that shortcut work for your Visual Studio editing, you just need to assign it to File.Close instead.
Initial setup for a new ASP.NET MVC site in IIS7
Background
Over the years, I have spent far too many hours running the same set of commands against ASP.NET and ASP.NET MVC sites to bring them up to what I consider a starting point. Most of the time, I have to refresh myself about how to do at least one of them. This is a list of those commands in a central location for myself and anyone else to use. As with any good instructions, there is no guarantee you won’t completely destroy your server, site, or soul using these commands. I can only say they worked for me once.
From jsFiddle to GitHub to AppHarbor to stackgeography.com
Update
I finally put together an app listing on StackApps. If you like stackgeography.com and you have a StackApps account, I’d love for your vote on the StackGeography app page.
Background
My latest project at my full-time job with Sierra Trading Post is their Mashery-managed API. It currently includes most everything you would expect from a retail API: departments, brands, products, search, and reviews. I would like it to include a few things that are less typical but fun to work with from a data aggregation standpoint. One example: recent order locations. While it may not see a lot of outside use, it would be quite nice for our internal observation; it would go great on the handful of large screens around the company with site statistics continually updating on them.
Adapting Visual Studio code styling differences for open source project contribution
Background
Today, while incorporating Lee Dumond’s MVC Route/URL Generation Unit Tester into a project, I found a desire to contribute some code I thought would make the package easier to use. Unfortunately, the project code formatting looks nothing like my preferred conventions (some form of 1TBS, I guess). Until Visual Studio offers a way to distribute code style settings to source control consumers easily, I needed a different option.
While preparing demos for a mobile web development talk for the Cheyenne Computer Professionals group, I stumbled on Mike Minutillo’s tip for running a “demo” instance of Visual Studio where I could sandbox my presentation settings optimized for an elderly VGA projector. This sparked an workaround idea for dealing with multiple formatting settings of various projects I may work on.
Rather than force my conventions on the project (generally not acceptable) or give up on my own style (generally not acceptable), I decided to try using a “demo” instance of Visual Studio with that projects styling conventions set.