Wednesday, November 28, 2012

Digital Signature pfx Blues and Fix

Update:  This does the same thing w/o having to use a visual studio extension/plug in.


Yes, it was machine migration time again. So I downloaded all my projects from team foundation server and went to debug...and...blam. Mycompany.pfx throws build errors. Now I know the password for the digital signature file (which is what the pfx files are) but I don't remember how they were setup. You can right click and install them, but there is a bunch of options that I'm not sure which of is correct. So I google, and I find this nifty little VS2010 extension-

I closed Visual Studio, downloaded and installed the extension, then restarted visual studio and opened my project that was giving me the pfx error.

Hit debug, build failed, right clicked the error in the error list window, and now there is an option called "Apply Fix." Right clicked it, a command window opened up asking me what the pfx password was, which I supplied, and got a confirmation that the pfx certificate was now installed.  Started up the project in debug, and everything worked!

Note, this utility only works for Visual Studio 2010 Pro version or above. There might be a 2008 version, and the 2010 version might work with Visual Studio 2012, but I haven't tried it yet.

More info on pfx issues here-

Note, it turns out this plugin isn't free.

Pro Application Lifecycle Management With Visual Studio By Rossberg, Joachim/ Olausson, Mathias (Google Affiliate Ad)

Tuesday, October 30, 2012

Localized Month From an Int (1-12)

Demo of getting localized month string from a number (note I'm passing the number in as a string and then TryParsing it this case (modify to suit).

Essential C# 4.0 By Michaelis, Mark (Google Affiliate Ad)

Tuesday, October 23, 2012

Using Bit Flags in SQL

Using bit flags is a great way to store a lot of information in a single place that can be used in a variety of ways, of which the most common I've seen is to use big flagging for permission checks. I could write the following post myself, but I don't think I could add much to the following excellently done reply to a question on StackOverflow about using bit flags in SQL, so here you go-


Also if you are a little rusty on using bit flags in .Net, here is a refresher article link-


Tuesday, July 10, 2012

Cross posted at

At the core of any game application is going to be a random number generator.  I found out that using .Net's base random class is fine for a one off or limited set of random numbers needing to generated, but once you start beating on the .Net random class you start seeing some funky results.  So for a little game demo I'm working on I put together a static class that generates random numbers based on the System.Security.Cryptography.RNGCryptoServiceProvider which seems work well even if it is a tad slow.

Here is the class.  Note the static method GetD6Successes.  This is meant to mimic the "exploding" D6 die pool mechanic used in some table top RPG's.  I like the concept as in theory a lone peasant has a chance, though a very very very small chance, of slaying a dragon with this mechanic.  Let me know what you think.

Friday, May 18, 2012

Quick Trick, Splitting on Multiple Characters

This is more of a Junior Varsity post, as I'm sure the .Net gods have figured this technique out a long time ago.  But for the rest of us, if you ever wanted to split a string on more than one character, this is how it is done in .Net, or at least one of possibly many ways it can be done. In this example I want to split on new line breaks and space characters.

string mybiglongstringwithlotsofnewlines = "a whole bunch of characters";
List < char > lst = Environment.NewLine.ToList < char > ;
lst.Add(' ');
string[] myarray = mybiglongstringwithlotsofnewlines.Split(lst.ToArray());

Happy coding!

Tuesday, April 10, 2012

Following Facebook Pages Through RSS

I love RSS, but it isn't really catching on like I thought it would. But most web applications, including Facebook, have ways of getting at content updates through RSS, you just have to hunt a little bit harder since RSS seems to not be hitting the mainstream.  Here is a helpful link on how to follow Facebook updates (pages and users) via RSS, and without even logging into Facebook (which should give you a little pause actually).

Thursday, March 22, 2012

How to Follow a User on Twitter Through RSS

I love RSS feeds.  I use them all the time.  On the old Twitter UI, a user's RSS feed link was available on each tweeter's home page.  For reasons unknown Twitter ditched that.  You can still follow individual tweeter RSS feeds though by doing the following two step process.

Step 1: Determine the tweeter's user ID.  There are lot's of ways to do this, but here is the easiest way:

Step 2: Replace XXXXX with the user's ID number in this link below, and you are good to go.

Happy Info Stalking!

This link helped me figure things out-

Sunday, January 29, 2012

Fix for Chrome Crashing with Youtube on Closing

Here is a temp fix for the issue when you are watching a youtube video in Chrome and then you try to fix it, Chrome crashes. Unfortunately the fix is to disable the two Flash dll's.  Chrome is working on a fix.  These two dll's can easily be re-enabled as needed.

* In the chrome URL window type about:plugins
* Click show details
* do a find on gcswf32.dll and NPSWF32.dll, disable them both.

For reference-