Wednesday, 18 March 2009

MSTest - Specified cast is invalid

Just remembered this one. When running a VSMDI from the command line (using the mstest command switch /testmetadata) sometimes this error just happens - no help just 'specified cast is invalid'.

I found out a while ago that if you have test lists that are empty this error sometimes happens. What you do is go to the VSMDI editor in visual studio and in the VSMDI in question ensure that you either have tests in each Test List, or remove the test lists that are empty.

One more hassle from MSTest!!!!

Tuesday, 17 March 2009

Generating SQL from the NHibernate mapping file

I spent 10 minutes searching for a simple program that would dump out the SQL that NHibernate generates from a mapping file if requested. In the end I just wrote my own. This is the relevant snippet.

                NHibernate.Cfg.Configuration config = new NHibernate.Cfg.Configuration();
                var export = new NHibernate.Tool.hbm2ddl.SchemaExport(config);
                export.Execute(true, false, false, true);

Monday, 16 March 2009

For future use

For those idle moments I like to visit - there's always a gem or two there. This morning I learned about quux's Excellent WMIC cheat sheet!

Friday, 13 March 2009

Finally it's out!

It's been a while coming and taken its toll in terms of long hours and hard work but the ADERANT team have finally released our new software - ADERANT Expert "Golden Gate" Release. I leave you read the press release but I must say it's an exciting release - workflow, DSLs, WCF, WPF, new User Experiences, - you name it - it's in there! Well done everyone!

Thursday, 12 March 2009

Awww what a shame ....

Sorry but I couldn't help but feel a tinge of sadness this.... Only joking!

Tuesday, 3 March 2009

Taking ownership of a file without explorer

Use the following command on vista (elevated) command prompt:

icacls full_path_and_filename.ext /setowner name_of_user_or_group

Notepad++ on Vista 64 - replacing Notepad.exe

There are links here and here (among many other places) that shows how to replace notepad editor with the excellent Notepad++ on a vista or xp machine as the system default text editor. If you use vista 64 you'll need to add another directory to the location where you replace the original notepad.exe


So the set is :


As always on Vista you'll need to jump through a few hoops to allow you to do this. The first is to replace the file owner with someone other than the default 'TrueInstaller' and secondly to give the new owner full control over the file.

The above links give more info if you need it.

Don't forget - you mess with windows at your own risk :-)