Friday, May 25, 2012

How To Get Started With CQRS

I’m reading about Autofac – another IoC framework that we use at work. Reading on the autofac page, I found out about CQRS and the more I read about it the more I like it. Being passionate about high scale services, the main concepts of CQRS really resonated with me :

CQRS separates commands (that change the data) from the queries (that read the data).

The design and architecture of a read only service and read-write service are different when it comes to scalability. With read-only services, you can add caching layer to improve hot reads. With read-write services, you have to think about consistency, where caching could turn out to be difficult, depending on the number of machines your services are working on.

More about CQRS – read here.

Thursday, May 24, 2012

HOWTO: Determine the current Powershell version

Today me and one of my coworkers were investigating a problem related to configuration of a new server machine. We have an batch script which automates tasks like configuring the new OS, pulling from Git repos, building locally and setting up the local Web apps. At one of the steps, the script failed where it was executing a Powershell script. That could be due to mismatch of Powershell version. So here are my findings:

1. On Windows 7 and Windows 2008 Server R2 (and newer), Powershell 2.0 comes with the OS. On Vista, Windows 2008 Server, you have to manually install it

2. If you want to make sure what is your current PS version, open up a Powershell window and type “$Host.Version” at the prompt. You will see the following output showing the version number – in this case 2.0:

image

Sunday, August 28, 2011

System.BadImageFormatException: Could not load file or assembly <assembly> or one of its dependencies. An attempt was made to load a program with an incorrect format.

I stumbled on this issue today. I have two projects – one that was built for x64, and another one, a test project – built for x86. The test project has a project reference to the library. When I try to execute any of the unit tests, I’m getting the following error:

System.BadImageFormatException: Could not load file or assembly 'assembly name here, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

I searched online and found the following article, which opened my eyes how to fix the issue:

http://support.microsoft.com/kb/967163

It’s clear what is the issue – x86 assembly is trying to access x64 assembly. The question is how to solve that issue. The answer is – set the “Platform Target” setting in the x64 assembly project config to “Any CPU”:

image

Monday, May 16, 2011

Fiddler: AutoTruncate setting in the response view

Today I found out about this setting in Fiddler. I’m used to see the raw HTTP response in Fiddler. I use the search feature, which comes very handy when you have a large response in size:

image

When I was searching for “moviesfe”, I noticed that I can’t find what I’m looking for. To note, I’m in “raw” response viewer format. However, when I switch to “TextView” and again type “moviesfe” in the search field, it just finds the data. For the same response. Somehow it doesn’t make sense – you cannot find a string in the Raw response, but when you switch to a viewer (more specifically TextView), the search term is found!

image

I looked closely at the Raw window and noticed the following message:

image

And that hinted what the problem can be. In Raw view, the text was just truncated, hence when you search for “moviesfe”, Fiddler cannot find the string. However, in TextView, this doesn’t happen since the text isn’t truncated. In order to disable text trancation in Raw view, you just need to right click in the view and disable “AutoTruncate” as shown:

image

Sunday, May 08, 2011

Resolving OneNote conflicts with Windows Phone 7

I’m a using OneNote quite a bit on my Samsung Focus (Windows Phone 7 OS). However, recently I started getting on the error message while opening up OneNote on the phone

“Conflicts occurred while syncing. Although you might not see all the changes on this page, your revisions will be saved. Use OneNote on your computer to resolve the conflicts”.

So I started up OneNote but I needed to have the location of the OneNote file which my Samsung loads from SkyDrive. In order to get the file path, you need to go to http://windowsphone.live.com/ and you will see on your right side a section “ONENOTE”:

image

You click on the “NOTES” link from above and Microsoft Web OneNote app will open up your notes in the Web browser. However, in order to resolve the conflicts you will need to open it up in the desktop version of OneNote. To do this, you click on the “Open in OneNote” button on the ribbon:

image

When you open up the OneNote with the conflicts, you will see the following message on the top:

image

Also, on the right side, where is the list of app OneNote pages, you will see the yellow icon with the blocking arrows, looking like this:

image

Choosing the conflict page, will show you a merged version. However,  if you want to see the version of the page that caused the conflict, you can click on the white item with the date (in the example above, it starts with 5/8/2011). Then, if some information was left off, you can easily copy it over to the merged version.

Finally, when you’re done with the conflict page, you can right click on it and you will see the following menu, from where you can remove the conflict:

image

Friday, June 15, 2007

Visual Studio 2005 Team System Training Videos

Today, I had to configure the code coverage support on one Visual Studio 2005 project. I guess you know, but the new Visual Studio Team System comes with code coverage support built in in addition to the unit tests that now can be even part of your solution (no need to use NUnit anymore). Turned out that it's really easy to use and is very powerful feature. If you have the same problem as mine, the following 2 minute movie (link) will show you exactly how that works. Actually, check out this location to find wealth of short videos with quick hints on different topics related to Visual Studio Team System:

[Visual Studio 2005 Team System Training Videos] (link)

Tuesday, June 12, 2007

TechEd'07from Orlando, US - Webcasts available online

If you haven't been to TechEd this year, or if you have been, but you want to see some of the talks there, go to this web site and check them out. There you will find the talks that been presented on TechEd'07 in Orlando, US. I think that these webcasts can give a good understanding of what Microsoft is developing and where it is heading to. Enjoy!