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!

Thursday, March 22, 2007

Virtual PC 2007

Very often you have the requirement to support multiple OS platforms, or if it is a Web app - multiple Web browser types. For this reason, in order to make a real test case, you need to have clean installations of all those OSs with no additional software or no more software that is actually needed by specification. However, sometimes you can't host multiple OS versions on one HDD, and even if you can, chances are that you won't use all of these distributions on daily basis, but rather only while running these system, integration or basic functional testing scenarios. One solution that I've used in this regards is Virtual PC which proved to be ideal and lightweight but very powerful. You may have different OS as images on your HDD (or DVDs in my case) and whenever you say need Windows 2003 with SP1, just take out the image and run the Virtual PC. Simple and very convenient.

Today I figured that a new verion of Virtual PC has been pushed out - Virtal PC 2007, which now supports Windows Vista natively. Take it for a spin from here.

Sunday, March 18, 2007

Scaling out with Microsoft SQL Server 2005

Scaling out is a major architecture factor to most heavy-traffic Web solutions. Turning back time, I see most of the Web solutions that I've been involved with having significant requirements for data load and performance. The bottleneck in most of those cases has been on the database layer, where at some point we have had to think about scaling out. Not surprisingly database performance and tuning have been very interesting to me and I am trying to constantly educate myself. This is how I found the following very good papers related to scaling out technologies with SQL Server 2005. They will give you a broad perspective on what SQL Server 2005 can give you to make your application more scalable. These papers have been written by Bob Beauchemin, who is a well-known speaker and profound database guru.

Planning, Implementing, and Administering Scaleout Solutions with SQL Server 2005 (link)

Internals, Troubleshooting, and Best Practices for use of Scaleout Technologies in SQL Server 2005 (link)

Configuring XBOX 360 with Wndows Vista Media Center

I spent some time today trying to figure out how to hook up my XBox 360 with my new and shiny Windows Vista. I am sure that many other people will bump into the same problem. So to make long story short, I have a XBox 360, which used to be connected to my Windows XP Media Center. However, I've recently upgraded to Windows Vista Ultimate and thus I had to made a transition. So at first, my XBox wasn't able to look up any Media Center PC in the network. I though it could be related to some security settings on my PC, tweaked this and that for a while, but still no result. Then as all developers do when they cannot solve something right away (without reading manuals :)), I searched the Net. I found this article, which turned out to be the one-stop-shop for what I was trying to do:

Enjoy Windows Media Center on your Xbox 360, with your Music, Pictures, Live and Recorded TV*, and Online Media (link)

So the important part of this article was that I have to "disconnect" my XBox 360 from any previous PC partnerships. Another thing that I took care of was really related to security and Windows Firewall in Vista. This matter is explained in detail in the following article:

Troubleshoot problems with a Windows Media Center Extender device (link)

However, to be honest, when you add the new XBox extender to your new Windows Vista Media Center, one of the steps in the setup process will ask you whether you want to open these ports on the Firewall so pay special attention to it.

Tuesday, February 06, 2007

The whole new Microsoft Project 2007

I've used Microsoft Project for many projects and I personally think it is an amazing product. Gantt charts, resource planning, timelines, critical paths - you can do all this with Project and many more. While Project 2003 brought a whole new breath of features, today I was amazed by the new capabilities that Project 2007 delivers - check out this site for a comparison between these two versions. Now you can manage non-working time (with the previous version, you have to create a "dummy" non-working time task so that it takes over the unallocated time slot). Gantt charts have been improved and now provide far more sophisticated views. There are far more reports that you can create with couple of clicks to different programs - Excel, Visio, etc. And for the most part, Project 2007 follows the new office and Vista look and feel with the fancy ribbon and improved usability. So, if you want to take it for a spin, go and take the trial version and play with it (link).

Tuesday, January 02, 2007

Windows Live Gallery

Probably you know that if you have a Windows Live ID you can log in and personalize your home page there. There is a huge set of gadgets available. Today I found the official gallery, where you can pick up and install those gadgets that your really like. Just hit this page (link) and see what's there. Some of my favorite are: Live Clock (link), Radio Live Space (link), ToDo (link) and Favorites (link).

You will find gadgets that you can use with your Windows Vista. These gadgets can be installed on your desktop so that you make use of the online connectivity of your machine.

Tuesday, December 19, 2006

Microsoft Office 2007 for a trial spin by the end of February

Microsoft has made the Enterprise version of Office 2007 for trial up until the end of February. This includes all Word, Excel, PowerPoint, Access, etc. At the end of the trial run, Office 2007 Enterprise will downgrade to a crippled edition that bars users from creating, changing, or saving documents and files. Users will still be able to view and print documents, however.

Download the free trial from here (~502.1 MB) (link) or check out the official trial site (link) for more information. You will need a trial licence key, which you can obtain from here.

Tuesday, December 12, 2006

"What the C or C++ Programmer Needs toKnow About C# and the .NET Framework" book by Charles Petzold

As I am coming from C++ background, long time ago while I was trying to catch up with .NET and C#, I would have died for a book like this:

"What the C or C++ Programmer Needs toKnow About C# and the .NET Framework" by Charles Petzold (link)

First thing you should note is the author - not everyone, but the famous Charles Petzold. Then you should notice that this book is completely free right now, so I really don't know what you are waiting for - just go there and download it :)

Monday, December 11, 2006

Service Unavailable error and IIS 6.0

Today I experienced very strange behavior from my local IIS 6.0. Everythime I accessed some web site previously working sound, I kept on getting this empty page saying "Service Unavailable". When I saw that all of my Web sites part of my current project are showing this same message, I tried to open a stand-alone and completely different Web app, but again the same message. Ok, that's was a clear indication that there was something wrong with the IIS6 installed on my local box. I hit the Internet and found the following KB article on MSDN site (link). This just rang up a bell that the problem can be rooted in the app pools I've been using. And it was a true suggestion - I had to change the identity under which my default ASP.NET 2.0 app pools were using (since the old one was not valid anymore). And now I have one greatly working IIS 6.0 up and running...

Tuesday, December 05, 2006

Exposing a MEX Endpoint

Today I found out the following. Let's say you have an Indigo service using the basic profile binding (BasicProfile) or any of the WS-* profiles. Then, you need a way to expose the metadata of your service to clients. Normally, you will define a new WS-MetatadataExchange (MEX) endpoint. But here is the trick. If your service is self-hosted, then if you specify a base address while opening the service, then you have this MEX endpoint created for you. Just point to the base address in your Web browser, and you will get the service description file or if you want the WSDL - just type the "?wsd" in the address bar. Here is a sample code that demonstrates this:

Uri baseAddress = new Uri( "http://localhost:8080/MEXAutoMetadataSvc" );

// NOTE: by specifying a base address, the MEX endpoint should be automatically populated especially for HTTP based profiles
myServiceHost = new ServiceHost( typeof( .. MEXAutoMetadataSvc ),
new Uri [] { baseAddress } );

//Open myServiceHost
myServiceHost.Open();

Now with this code running, if you go to http://localhost:8080/MEXAutoMetadataSvc you will see the description for this service.

Friday, December 01, 2006

Windows Vista and Office 2007 webcasts

If you want to ramp up with the cool and fascinating features that Vista and Office 2007 provide to us (developers), you may want to check out this site:

http://www.powertogether.com/

There, you will find a realm of online virtual labs and web casts, bundled up to give you one-stop-and-shop place to speed up with that technology, which IMO is really revolutionary. And don't get me wrong - I don't think of Windows Vista as of the new Microsoft OS with the very sleek UI, but also with all of its major improvements in security, connected systems development (and Microsoft .NET framework 3.0) and totally revamped way of interacting with your PC. I can tell you that having Vista on my desktop, I will never think of moving back to any previous OS.

As far as Microsoft Office 2007 is concerned, I will really recommend you just playing with it for couple of hours. Then send me back your comments. However, back on the link I gave you here, there is a good overview of what's into the developers toolbox for Office 2007 so it's worth to go there and master these.

Wednesday, November 08, 2006

Windows Vista released

Windows Vista RTM is finally here! Check out the official Vista blog for more info (link). You will love it - that's for sure! :)

Visual search engine - amazing!

Search is definitely a lucrative area, which is constantly evolving and looking for innovation. So today I ended up on this very cool search enginge like.com. Check it out! It is not rich of available items among which you can search of, but the idea behind it - to have visual search capabilities is really great. For instance, you can draw on a bag saying that you most like the shape of it and this guy will return you all the bags which have similar shape :) Cool, isn't it? Another thing is the ease of use - this engine is defintiely user-friendly and I am sure that even elderly people can deal with it - it is so easy and intuitive :) So be it - go to like.com and check it out.