It's crude, and it breaks the VS 2010 Build, but it works in VS 2012

... mostly. I have not tested it extensively.