Wednesday, 27 July 2016

Where to find Reactive Extensions 2.2.5

The latest and greatest Reactive Extensions v3 has been released.
With it came a name change to the NuGet packages:
  • Rx-Main is now System.Reactive
  • Rx-Core is now System.Reactive.Core
  • Rx-Interfaces is now System.Reactive.Interfaces
  • Rx-Linq is now System.Reactive.Linq
  • Rx-PlatformServices is now System.Reactive.PlatformServices
  • Rx-Testing is now Microsoft.Reactive.Testing
And the old packages have been unlisted.

If you have a need to install the older packages, as I have, then all you need to do is specify the version command line parameter when using Install-Package, which seems to be your only option.

Install-Package Rx-Main -Version 2.2.5

Check if Google Play Services are availble in Xamarin

This is actually pretty easy. Make sure you have Xamarin.GooglePlayServices.Gcm installed in your project.  Then use the following code:

Remember to call GoogleServices.Init(this) in your MainActivity after Forms.Init(this, bundle).

Tuesday, 26 July 2016

Android.Content.ActivityNotFoundException: No Activity found to handle Intent

I you get the following error message when trying to email using an Android emulator:
Android.Content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.SEND_MULTIPLE typ=text/plain flg=0x10000000 (has extras) }
Then you most likely do not have email setup in the emulator.  Install Google Play on the emulator and setup an email account.

Wednesday, 20 July 2016


If you need to apply a FilterAttribute to all your MVC controllers and actions, but still be able to override the default behaviour, then you can use the following:
FilterProviders.Providers.Add(new DefaultFilterProvider<NoAuthorizeAttribute, AuthorizeUserAttribute>());

Saturday, 9 July 2016

Debug Android applications over Wi-Fi

Note to self:
  • Connect your Android device via USB, and make sure that USB debugging is working.
  • Open the Android Adb Command Prompt
  • Enter the following:
adb tcpip 5555

  • Find the IP Address of the device:
adb shell netcfg

  • Now connect to the device 

    adb connect <device.ip.address>:5555

    • You should now be able to disconnect the device from USB and be able to debug over Wi-Fi 

    Sunday, 29 May 2016

    java.lang.OutOfMemoryError. Consider increasing the value of $(JavaMaximumHeapSize). Java ran out of memory while executing 'java.exe'

    I was getting a java.lang.OutOfMemoryError while trying to compile a Xamarin Android application after adding HockeyApp.

    I found to ways to resolve this.

    The first option is to add a Environment Variable called _JAVA_OPTIONS and set it to -Xmx1g.  This sets the JVM heap size to 1GB.  You can either do this from the commandline by calling
    SET _JAVA_OPTIONS = -Xmx1g
    Or you can edit your system environment variables:

    The second and my preferred option was to to update the Java Max Heap Size in the Advanced Android Options tab in the Xamarin Android Visual Studio project:

    Wednesday, 18 May 2016

    The specified solution configuration “Debug|X64” is invalid

    I have a build script that finds all the solutions in a version control repository and builds them.  I do not specify the platform as many of the solutions and projects have different platform settings.

    Today in one of the branches my script started giving me the following error:
    The specified solution configuration “Debug|X64” is invalid
    Adding the following to the start of my build script solved this issue:

    Tuesday, 17 May 2016

    TFS: Undo checkout of unmodified files

    Here is another one of those shortcuts I have not been aware of. :D

    I hate TFS version control.  There are many reasons, but one irritating thing is that it is incapable of detecting if a file has actually changed or not.

    Here is a little commandline script you can run in your project to undo all unchanged files:
    tfpt uu . /noget /recursive
    Note: You need to install Team Foundation Server Power Tools.

    Thursday, 31 March 2016

    I've been using on my development machine at work for about 3 weeks now.  It has been pretty amazing the insights it gave me to what the code base I am working on is doing.

    After an early hiccup, which was quickly resolved by the awesome Matt Watson, the installation is a breeze, and it just works, with no perceived impact on CPU or memory usage.

    I have not had the opportunity to use Stackify APM yet, but if it is half as good as Prefix then everyone should be using it.

    Great job Matt and thank you for a fantastic tool!

    Monday, 11 January 2016

    How to setup Node.js and npm behind a corporate web proxy

    Proxy with no authentication:

    npm config set proxy
    npm config set https-proxy

    Proxy with authentication:

    npm config set proxy
    npm config set https-proxy

    These examples use as the proxy server url and 8080 for the port number.