Sunday, August 15, 2010

Ignore Error From Visual Studio Post Build Event

If, for whatever reason, you want to execute a command from a Visual Studio build event, and you don't care if that command returns an error, then do the following:
[command to execute] 2>nul 1>nul
EXIT 0
The 2>nul 1>nul will swallow the stderr and stdout from the command. The EXIT 0 will make sure the build event returns 0.

This post explains how MSBuild decides whether or not a command executed in a build event has failed. If you control the command your executing, you may be able to change how it writes to stderr and stdout and avoid swallowing those streams. If you don't control the command, you'll have to swallow.

This technique may not be helpful if your build event is more complicated. But if your situation matches this simple scenario, the technique works like a champ!

Thursday, July 8, 2010

WCF Active Federation and Bearer Tokens

If you're using WCF's WS2007FederationHttpBinding, and you want the issued token to be a Bearer token, then you need to set IssuedKeyType of the message section to Bearer.

var binding = new WS2007FederationHttpBinding();
binding.Security.Mode = WSFederationHttpSecurityMode.TransportWithMessageCredential;
binding.Security.Message.IssuedKeyType = System.IdentityModel.Tokens.SecurityKeyType.BearerKey;


The default IssuedKeyType is Symmetric, which is a holder-of-key token. I'll talk about why I needed a bearer token in a future post.

Friday, October 16, 2009

X.509 Certs for WCF Development

If you're a WCF developer and you need to build a secure service, you'll need certs for your workstation. If you're working for a bigger company, you may need multiple certs to mirror your production environment more closely.

If you're not sure how to create self-signed, trusted certs on Windows, check this out:

How to: Create Temporary Certificates for Use During Development

MSDN FTW!

Thursday, September 3, 2009

DVCS and Feature Branching

Another interesting point of view from Martin Fowler.

http://martinfowler.com/bliki/FeatureBranch.html

Saturday, August 1, 2009

Synergy Screen Switching

Want a keyboard shortcut for switching screens with synergy?

Synergy Tricks: Switch Screens With a Keyboard Shortcut

Thanks Geemoo!

Thursday, July 9, 2009

Training for Programmers

Neat article on programming workouts.


Kicking Your Coding into High Gear

Making your code readable

Interesting article from Scott Bellware on making your code readable to cut down on waste.

Relearning: The Productivity Problem that We're Not Supposed To Talk About