Thursday, October 22, 2009

Visual Studio 2010 & .NET Framework 4.0 Training

Well, I am sure we have all been hearing and reading about the new betas for Visual Studio 2010 and .NET Framework 4.0. I am sure some of us have downloaded them and are playing with them as well. But, Microsoft has made it easier for us. They have released a training course dedicated to these platforms. Download it today and live on the cutting edge.

The pre-requisites are:

and a burning desire to learn…

The Visual Studio 2010 and .NET Framework 4 Training Course includes videos and hands-on-labs designed to help you learn how to utilize the Visual Studio 2010 features and a variety of framework technologies including: C# 4.0, Visual Basic 10, F#, Parallel Computing Platform, WCF, WF, WPF, ASP.NET AJAX 4.0, ASP.NET MVC Dynamic Data.

While you are at it, check out some cool content on Visual Studio 2010 and .NET Framework 4.0 on Channel9.

Wednesday, October 14, 2009

How-to: Use Cucumber with .NET and C# under IronRuby

I will not go into how cool Cucumber is and all that because it is already established. If you have not experienced it, I think you should. It will make a big difference in how you look at code, testing and TDD.

I started using Cucumber on Ruby on Rails projects and I wanted to use it on .NET/C# projects. So, I will in very clear steps show you how to get Cucumber going for your C# projects. This post is just a primer to get your feet wet, but I will come back with follow up posts that will show a more complete project. So, here goes.

Step 1: Setup Ruby (MRI)

  • Download Ruby
  • Install Ruby (MRI version)
  • Check version of ruby and rake
    • ruby -–version
    • rake -–version
  • Update RubyGems
    • gem update --system

Step 2: Setup Cucumber and RSpec using MRI gem

  • Install cucumber gem
    • gem install cucumber
  • Install rspec gem
    • gem install rspec

Step 3: Setup IronRuby

  • Download IronRuby
  • Install IronRuby. I had to just unzip the file I downloaded into C:\IronRuby folder. You can pick any folder or choose to build IronRuby from source.

Step 4: Create a Cucumber wrapper for IronRuby

  • We need to create a script that will execute Cucumber under IronRuby very similar to cucumber.bat in your MRI Ruby folder. I have my MRI Ruby installed at C:\ruby.
  • Create a new icucumber.bat file in your MRI Ruby folder with the following contents:
    • @ECHO OFF
      REM This is to tell IronRuby where to find gems.
      SET GEM_PATH=c:\ruby\lib\ruby\gems\1.8
      @"C:\ironruby\build\debug\ir.exe" "c:\ruby\bin\cucumber" %*
  • Check to see if Cucumber under IronRuby works
    • icucumber –help
    • you should see something as below. The output has been cut to preserve space.
    • Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+

      cucumber examples/i18n/en/features
      cucumber --language it examples/i18n/it/features/somma।feature:6:98:113
      cucumber -s -i
      http://rubyurl.com/eeCl

    Step 5: Checkout some examples

    • In a command prompt window, go to the cucumber gem folder under your MRI Ruby installation. The folder path might look like C:\ruby\lib\ruby\gems\1.8\gems\cucumber-<version>\examples
    • Now, run a Ruby example:
      • cd i18n\en
        icucumber features
    • Now, for the litmus test, run a C# example:
    • cd cs
      compile.bat
      icucumber features

    You should see a lot of output scroll by and at the end you should see:

    3 scenarios (3 passed)
    12 steps (12 passed)
    0m0.493s

    Bliss! You have Cucumber running under IronRuby and running Cukes (that is what cucumber features are called) for your C# .NET code.

    Feedback: I would like to hear from you about your experience running Cucumber for your C# projects.

    Resources

    IronRuby/Ruby Links

    IronRuby website

    IronRuby Wiki

    Ruby website

    Cucumber Screencasts

    http://railscasts.com/episodes/155-beginning-with-cucumber

    http://railscasts.com/episodes/159-more-on-cucumber

    Cucumber Presentations


    Free ASP.NET MVC Poster

    RedGate has a free ASP.NET MVC poster for download.

    By the way, the original diagram taken from Pro ASP.NET MVC Framework (Steven Sanderson, Apress). This is a great book.

    Tuesday, September 15, 2009

    Vanishing Magic folders in Vista

    One of my friend at work had a strange issue today. He was seeing some folders and on clicking these folders he was getting an “Access denied” error message in Windows Explorer in Vista Enterprise SP1. The folders in questions are the ones with the little shortcut arrow icons next to them, as shown below:

    Vista Magic Folders

    The error message was as follows:

    Vista Magic Folders Message

    Well, the interesting thing I noticed is that these magic folders as I call them, look like the old XP folders somehow left over. I could not find a reason why they were here but I did find a way to get rid of them or at least not have to see them by turning off the “Hide protected operating system files (recommended)” setting under Organise->Folder and Search Options->View tab as shown below:

    Vista Magic Folders_3

    Once you check this setting on, poof, the mysterious magic folders are gone.

    Hopefully, someone will benefit from this tip, as did my friend at work.

    If anyone has found out what these folders are, please leave a comment as I am curious to know.

    Technorati Tags: ,,

    Thursday, July 30, 2009

    Error: The Visual Studio performance and coverage logging engine is already running on the computer

    I have been head down into writing some tests and debugging them in Visual Studio 2008, and every other time I would get see that my test would get a yellow triangle with an exclamation sign and it said “Not Executed”. On clicking on the link for the error, the following error message is displayed:
    Code coverage collection error: The Visual Studio performance and coverage logging engine is already running on the computer. Therefore, the test run cannot continue. Close the pending performance or code coverage session and then rerun the tests.

    Although it was beyond me why Visual Studio performance engine would run but it was easy to just find it in Task Manager and just kill it.


    Problem solved for now….

    Free book: Mastering PowerShell by Dr. Tobias Weltner

    This free digital version of the 567 page book, is a very detailed coverage of PowerShell V1 by the PowerShell MVP Dr. Tobias Weltner. He is also the inventor of the amazing PowerShell Plus.

    The Table of Contents are:

    Download Mastering PowerShell PDF book.

    Other related links:

    Download Windows PowerShell

    Windows PowerShell Team blog
    Windows PowerShell ScriptCenter 

    Technorati Tags:

    Saturday, July 25, 2009

    How to: Stress Test / Load Test databases

    Well, we are often in a situation when we are near a release or adding more functionality or exposing more users to our application. One of the things we need to take care of is to make sure our infrastructure and our databases will live up to the extra load/stress. In this article we will see how we can stress/load test our database. To make it more organized it is desirable to create tests that relate to one or more usage scenarios. That way, we can pin-point what usage scenario has to be fixed for performance. It also in a way tells us which usage scenarios will work under the increased stress/load.

    The simple idea is like this:

    • Run your application and record the database trace calls via SQL Profiler for a particular usage scenario.
    • We can break up the whole application into small usage scenarios so we can test and monitor them separately.
    • Perform operations on our application for one single user.
    • Take the SQLTrace/Profile output which tells us all the db operations that happen on a specific case for a single user.
    • Write a wrapper SQL script using all the above sql calls and run that in a loop for 100, 200, 300, 400 users with other varying parameters.

    Well, what do you. I found a tool that does exactly that. Introducing SQL Load Test Tool.

    SQL Load Test Tool, takes a SQL Profiler trace file and generates a unit test that replays the same sequence of database calls found in the trace file. The unit test is designed to be used in a Visual Studio Load Test. The code generated is easily modifiable so that data variation can be introduced for the purpose of doing performance testing. The tool generates code for both Visual Studio 2005 and Visual Studio 2008. The user can start with using the application to generate a trace of the SQL statements which typically represent a usage scenario. They can then turn the trace into equivalent ADO.NET code program that can be used in a load test.

    The tool generates a Visual Studio 2005/2008 Unit Test from a SQL Server Profiler trace. It extracts all the SQL statements and stored procedure calls from the trace and turns them into a single Visual Studio Unit Test, which can then be configured as a Visual Studio Load Test. The tool does not interact with the database itself when it analyzes the trace and generates the test code. It can therefore be used in “offline” scenarios.

    The tool is intended to be used in conjunction with a client program that runs against a database. A trace of the client’s SQL Server activity is captured using the SQL Server Profiler. This represents a test scenario, which is then processed by the tool to produce a Unit Test that replays the scenario.

    Installation and setup

    1. Make sure SQL Server 2005 SDK is installed.

    2. Make sure you have SQL Server 2005 Management Tools installed.

    3. Install SQL Load Test tool.

    4. You will need one of the following installed:

    • Visual Studio 2005 Team Edition for Testers
    • Visual Studio 2005 Team Suite
    • Visual Studio Team System 2008 Test Edition
    • Visual Studio Team System 2008 Team Suite

    Supported Functionality (from SQL Load Test site)

    • SQL Server 2005 only (others not tested).
    • ADO.NET 2.0 (others not tested).
    • Most data types.
    • Named input, output and input-output parameters.
    • Positional input parameters to stored procedures.
    • Operation timers generated for each database call.

    Other helpful tools and utilities regarding stress and load testing databases

    Read more about SQL Load Test tool at its Codeplex site. The site also includes a SQL Server 2008 Profiler template file for download to used with SQL Server 2008 databases. The tool is licensed under Ms-PL.

     

    Monday, June 08, 2009

    Apple launches new iPhone 3GS and ships iPhone 3.0 software

    New iPhone 3GS phone Well, I had earlier written about the new iPhone 3.0 software updates, and now that software is being shipped by Apple to general public on June 17th, 2009. Download the update from the Apple site. Earlier, it was only available as part of the updated iPhone SDK for the developers.

    Also, the new iPhone 3GS version has been launched for $199 (16GB) and $299 (32GB). Also, note that the now old iPhone 3G is being sold at a revised rate of $99 (8GB).

    So, what you get extra with the new iPhone 3GS hardware? In summary you get the following features:

    image

    3 megapixels
    Autofocus
    Video recording

    Speed Icon Improved Performance
    Video Icon Built-in video camera with editing
    Voice Icon Voice Control
    Compass Icon Compass

    For a full list of features available with iPhone 3GS, please check http://www.apple.com/iphone/iphone-3g-s/. Check out a guided tour of the new iPhone 3GS phone at http://www.apple.com/iphone/guidedtour/#medium.

    For a detailed side by side comparison betwen iPhone 3GS and iPhone 3G, please check page at http://www.apple.com/iphone/compare-iphones/

    For consumers like me, who just got their iPhone 3G when it was announced, we can rejoice that Apple is released the iPhone 3.0 software for free and it includes some cool features which I mentioned in a previous post. The summary of those features would be:

    image

    Cut, Copy & Paste

    Messages Icon Messages
    Search Icon Spotlight Search
    Landscape Icon Landscape keyboard
    Voice Memo Icon Voice Memos

    If you have upgraded to the new iPhone 3.0 software or bought a new iPhone 3GS phone, please feel free to share your views.

    Friday, May 08, 2009

    Rails Magazine releases RailsConf 2009 Special Edition

    Special Edition – RailsConf 2009 Report!

    Special Edition – RailsConf 2009 Report! This concise issue of Rails Magazine covers RailsConf 2009 – in-depth commentary, photography, pointers to related resources and an interview section.

    If you did not attend RailsConf, this is one of the best ways to get up to speed on the conference, what’s planned for Rails 3 and related information.

    For those who attended, this should provide a good recap and insights by presenting different perspectives.

    As usual, we will provide this issue as a free pdf download in maximum two weeks. The print edition is already available and can be purchased through MagCloud for $3.

    Please check back our site for our next regular edition – coming soon!

    Buy print edition

    Table of Contents

    A Word From the Editor by Olimpiu Metiu

    RailsConf 2009 Roundup - Have it your way... by Casper Fabricius

    Resources by Khaled al Habache

    The Unofficial Guide to What’s New in Rails 3 by Rupak Ganguly

    Interview with Ben Johnson by Ben Johnson and Bob Martens

    Artwork by Duncan Davidson

     

    Google