Team Foundation Server 2010 (TFS) Administration Guide

“Effective administration of Team Foundation Server is important to the success of your team projects”

Microsoft recently released an administration guide for TFS 2010 Administration Guide for Microsoft Visual Studio 2010 Team Foundation Server. This is a compiled help file (.chm) version of the administration guide for Team Foundation Server 2010.

Similarly you can also download the Team Foundation Installation Guide 2010 includes instruction for installing Team Foundation Server and Team Foundation Build Services

Also check out some excellent articles written by MVP Subodh and Gouri Sohoni – Articles on Visual Studio 2010 Team Foundation Server

Using jQuery to Toggle Images with Radio Buttons

Here’s a simple example to toggle Images using Radio Buttons:

<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Toggle Images using RadioButtons</title>
<
script type="text/javascript"
src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js">
</
script>
<
script type="text/javascript">
$(document).ready(function() {
$("input:radio[name=rdImg]").change(function() {
if (this.value == "0") {
$("#imgOne").attr(
'src', 'http://theimagepathcomeshere.jpg'
);
}
else {
$("#imgOne").attr(
'src', 'http://thesecondimagepathcomeshere.jpg'
);
}
});
});
</script>
</
head>
<
body>
<
label><input name="rdImg" type="radio" value="0" />Image 1</label><br />
<
label><input name="rdImg" type="radio" value="1" />Image 2</label><br />
<
img id="imgOne" />
</
body>
</
html>

Similarly you can add multiple radio buttons and toggle multiple images with it.

Just use the value of each radiobutton to toggle the right image.

See a Live Demo

.NET 4.0 has 2 Global Assembly Cache (GAC)

While reading an article on Understanding The CLR Binder, I found out that .NET 4.0 has 2 distinct GAC’s (Global Assembly Cache). In previous .NET versions, when I installed a .NET assembly into the GAC (using gacutil.exe), I could find it in the ‘C:\Windows\assembly’ path. With .NET 4.0, GAC is now located in the 'C:\Windows\Microsoft.NET\assembly’ path.

Note that previous versions of .NET continue using the same ‘C:\Windows\assembly’ path. The article says:

In .NET Framework 4.0, the GAC went through a few changes. The concept of placing assemblies into a global directory began in CLR v1.1. In case of .NET Framework 1.1 (which had CLR v1.1) and .NET Framework 2.0 (which had CLR 2.0), the GAC was split into two, one for each CLR. This avoided the leaking of assemblies across CLR versions. For example, if both .NET 1.1 and .NET 2.0 shared the same GAC, then a .NET 1.1 application, loading an assembly from this shared GAC, could get .NET 2.0 assemblies, thereby breaking the .NET 1.1 application.

The CLR version used for both .NET Framework 2.0 and .NET Framework 3.5 is CLR 2.0. As a result of this, there was no need in the previous two framework releases to split the GAC. The problem of breaking older (in this case, .NET 2.0) applications resurfaces in Net Framework 4.0 at which point CLR 4.0 released. Hence, to avoid interference issues between CLR 2.0 and CLR 4.0, the GAC is now split into private GACs for each runtime.”
Interference Issues? Hmm..Interesting although I am still pondering over the reason! So that means, the GAC split reasoning in a .NET 4.0 scenario could be re-quoted as “If both .NET 2.0 and .NET 4.0 shared the same GAC, then a .NET 2.0 application, loading an assembly from this shared GAC, could get .NET 4.0 assemblies, thereby breaking the .NET 2.0 application”

I am eager to try out a scenario to see it myself. The baseline is, you now have 2 GAC’s in .NET 4.0 and you will now have to manage each of them individually!

Any other reasons you can think of the .NET 4.0 GAC split? Feel free to share them in the comments section.

Does installing .NET 4.0 Framework replace the previous .NET versions?

I get this question all the time with developers asking if installing .NET 4.0 will replace the existing .NET 3.5 framework on their machine. The answer is NO.

.NET 4.0 framework does not replace or remove the previous .NET frameworks. .NET 4.0 successfully installs side-by-side with previous versions of .NET framework including .NET 3.5, 3.0 or even 2.0.

Also note that using Visual Studio 2010 IDE, you can target your applications to use the framework of your choice, i.e. you can use the same IDE to build .NET 2.0, 3.5 and 4.0 apps on the same machine. You just have to choose your desired framework when creating a new project, as shown below

image

Skip and Select Elements in a String Array using LINQ

Here’s how to skip and select elements in a string array using LINQ. In the example shown below, we will skip the first two elements of an array and select the next three.

C#

static void Main(string[] args)
{
string[] arr = {"One", "Two", "Three",
"Four", "Five", "Six",
"Seven", "Eight"};
var result = from x in arr
.Skip<string>(2)
.Take<string>(3)
select x;

foreach (string str in result)
{
Console.WriteLine("{0}", str);
}

Console.ReadLine();
}

VB.NET

Sub Main(ByVal args() As String)
Dim arr() As String = {"One", "Two", "Three", "Four", "Five",
"Six", "Seven", "Eight"}
Dim result = From x In arr.Skip(Of String)(2).Take(Of String)(3)
Select x

For Each str As String In result
Console.WriteLine("{0}", str)
Next str

Console.ReadLine()
End Sub

OUTPUT

Three
Four
Five

Create a Transparent jQuery UI AutoComplete Menu

Let us quickly see how to create a Transparent jQuery UI AutoComplete Menu. Here’s some code to implement the AutoComplete Menu. We will make it transparent in a bit.

<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Load Page Dynamically inside a jQuery UI Dialog</title>
<
link rel="Stylesheet" type="text/css" href="http://ajax.googleapis.com/
ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" />
<
script type="text/javascript" src="http://ajax.microsoft.com/ajax/
jquery/jquery-1.4.2.min.js"></
script>
<
script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jqueryui/1.8.1/jquery-ui.min.js">
</
script>


<
script type="text/javascript">
$(function ()
{
var names =
["james", "jake", "jaffer", "mary",
"maddy", "aaron", "annie", "keith"];
$("#tags").autocomplete({
source: names
});
});
</script>
</
head>
<
body>
<
div class="ui-widget">
<
label for="tags">Names: </label>
<
input id="tags" />
</
div>

</
body>
</
html>

By default, the menu shows up like this:

image

Now to add some transparency to the autocomplete menu, use the following CSS

<style type="text/css">
.ui-autocomplete.ui-menu
{
opacity: 0.4;
filter: alpha(opacity=40); /* for mozilla */
}
</style>

The output is as shown below:

image

See a Live Demo

Load a Page Dynamically inside the jQuery UI Dialog

The jQuery UI Dialog is a floating window that contains a title bar and a content area. The dialog window can be moved, resized and closed with the 'x' icon by default.

Let us see how to load content dynamically inside this Dialog

<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Load Page Dynamically inside a jQuery UI Dialog</title>
<
link rel="Stylesheet" type="text/css" href="
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css
" />
<
script type="text/javascript" src="
http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js">
</
script>
<
script type="text/javascript" src="
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.1/jquery-ui.min.js">
</
script>

<
script type="text/javascript">
$(function () {
$('<div>').dialog({
modal: true,
open: function ()
{
$(this).load('Sample.htm');
},
height: 400,
width: 400,
title: 'Dynamically Loaded Page'
});
});
</script>
</
head>
<
body>

</
body>
</
html>
 

As you can see, we are creating a div element on the fly and specifying a callback for the open event, which loads the content of the page ‘Sample.htm’ dynamically.

Update: As commented by AdvanCode, opening and closing the dialog multiple times will not remove the dialog from the page. If you want to implement the close event, use this code in the dialog options (untested code):

close: function(e, i) { $(this).close(); }

That’s all! The output, when the page loads, is as shown below:

image

5 jQuery Calendar Plugins that can be used on Websites

Online calendars can be very useful to share and publish your schedules. One of the most common requests I receive from my jQuery readers is for a good, free-to-use, jQuery Calendar control, similar to the Google Calendar, which can be added to a website or blog.

Here are some of the freely available jQuery Calendar plugins, worth trying out. Please note that this post is about jQuery Calendar Plugins and not DatePicker controls.



jQuery Full Calendar Plugin

FullCalendar is a jQuery plugin that provides a full-sized, drag & drop calendar. It uses AJAX to fetch events on-the-fly for each month and is easily configured to use your own feed format (an extension is provided for Google Calendar). It is visually customizable and exposes hooks for user-triggered events (like clicking or dragging an event). Supports jQuery UI Themes.

image


Latest VersionFullCalendar 1.4.6 (May 31st, 2010)


jQuery Frontier Calendar

The jQuery Frontier Calendar is a full month calendar jQuery plugin that looks like Google Calendar. Supports drag-and-drop on agenda items, and iCal VEVENT import. Customizable style via CSS file.
image

Latest Version - jQueryFrontierCalendar 1.3.1 (June 23rd, 2010)


jQuery Event Calendar Plugin


wdCalendar is a jQuery based Google calendar clone. It cover most Google calendar features. You can integrate it with a database and can have daily, weekly or monthly views. Events can be created, updated or removed by using drag & drop operations.

See a Demo


image


Latest Version - wdCalendar


jQuery Week Calendar

The jquery-week-calendar plugin provides a simple and flexible way of including a weekly calendar in your application. It is built on top of jquery and jquery ui and is inspired by other online weekly calendars such as Google calendar. Currently this project is not being maintained, but contains a lot of features out-of-the-box for you to tweak.

image


Latest Version - jquery-weekcalendar-1.2.2


jQuery iCal-like Calendar

Although not like the Google Calendar, I thought this iPhone-like calendar deserves a mention here. The iCal-like calendar, created by Stefano Verna is created using only CSS and jQuery. The calendar has a relatively plain HTML structure and also contains a lightweight Coda-like effect for events description popups.

See a Demo


image

Latest VersioniCal-like-calendar


So the next time you are looking out for a free jQuery Calendar plugin for your website, I hope this post will help you find one.

You can also check my posts on the jQuery UI DatePicker

Create a Hyperlink of an Image using jQuery

Here’s a quick and easy way to create a Hyperlink of an Image using jQuery. Let us say you have the following image tags on the page:

<img alt="" src="http://www.dotnetcurry.com/Images/linq.gif" />
<
img alt="" src="http://www.dotnetcurry.com/images/Question.gif" />

To convert these images to hyperlink, we will use the jQuery wrap() function as shown below:

<script type="text/javascript">
$(function ()
{
$("#replAll").click(function ()
{
$('img').each(function ()
{
var currImg = $(this); // cache the selector
currImg.wrap("<a href='" + currImg.attr("src") + "' />");
});
});
});
</script>

What happens here is whenever the user clicks on the button, the wrap function wraps the anchor HTML structure around each image. After you click the button, you will observe that the images have become ‘clickable’, since they are now hyperlinks.

See a Live Demo

Place Opening Braces in a New Line for a JavaScript function – Visual Studio 2010

Developers have different way of indenting JavaScript code in Visual Studio 2010. When it comes to methods, some of them keep the opening braces in the same line of the method declaration like this:

<script type="text/javascript">
function
someFun() {
}
</script>

This is also the default indentation in Visual Studio 2010. If you want to change that and place opening braces in a new line, then Go to Tools > Options > Text Editor > JScript > Formatting > Check the box ‘Place open brace on new line for functions’

image

Now when you type the same function and hit enter before the last braces, Visual Studio indents the opening braces on a new line as shown below

<script type="text/javascript">
function
someFun()
{
}
</script>

Free Office 2010 Training

Here’s a quick and easy way to get up and running with Office 2010. Microsoft has some free Office 2010 Training courses for you to study online. Here are the links:

Access 2010 Training

Excel 2010 Training

OneNote 2010 Training

Outlook 2010 Training

PowerPoint 2010 Training

Project 2010 Training

SharePoint 2010 Training

Word 2010 Training

Note: The latest version of Microsoft Office 2010 is now available to purchase online.

image

Is my JSON Valid?

If you have been stuck with a JSON error and are not sure if your JSON is valid, use JSONLint.

JSONLint is a web-based tool for validating and reformatting JSON. Paste in some JSON and it’ll give you the syntax errors, if any. So let us say you give this tool the following input:

[{"ID":"1","Name":"Keith"}, {"ID":"2","Name":"Bill},
{"ID":"3","Name":"Govind"}, {"ID":"4","Name":"Kathy"}]

The tool returns an error message indicating unexpected TINVALID at line 9

Valid JSON Tool

What this error message means is that you have not enclosed your collection keys in quotes. On close observation, you can see the quotes on Bill (with ID 2) is not closed properly, hence causing the error. Specifying the quotes parses the JSON successfully. Also note that the tool neatly reformats the JSON output for us.

Valid JSON Tool

Pure JavaScript Version

There is a pure JavaScript version of the JSONLint service provided over here by Zach Carter, which makes it is easy to host this service on your own.

When I gave this tool the same input, the location of the error was much more easier to locate than I could do with the JSONLint service. Observe the arrow (circled) which pinpoints that the error is on the string Bill.

Valid JSON Tool

Bookmark this link for future use.

Windows Azure Platform Training Kit Update

Microsoft recently released the latest update to its FREE Windows Azure Platform Training Kit.

Quoted from the site “The Azure Services Training Kit includes a comprehensive set of technical content including hands-on labs, presentations, and demos that are designed to help you learn how to use the Windows Azure platform including: Windows Azure, SQL Azure and AppFabric. The June release includes new and updated labs for Visual Studio 2010.”

Here is what is new in the kit:

  • Introduction to Windows Azure - VS2010 version
  • Introduction To SQL Azure - VS2010 version
  • Introduction to the Windows Azure Platform AppFabric Service Bus - VS2010 version
  • Introduction to Dallas - VS2010 version
  • Introduction to the Windows Azure Platform AppFabric Access Control Service - VS2010 version
  • Web Services and Identity in the Cloud
  • Exploring Windows Azure Storage VS2010 version + new Exercise: “Working with Drives”
  • Windows Azure Deployment VS2010 version + new Exercise: “Securing Windows Azure with SSL”
  • Minor fixes to presentations – mainly timelines, pricing, new features etc.

This training kit also contains Hands On Labs, Presentations and Videos, Demos, Samples and Tools.

Download the Windows Azure Platform Training Kit.

Enumerate Hidden Directories in .NET 4.0

In one of my previous posts, I had discussed 7 New methods to Enumerate Directory and Files in .NET 4.0.

Let us see a practical example of using the DirectoryInfo.EnumerateDirectories to list the names of only hidden directories in a drive.

C#

static void Main(string[] args)
{
// dir is a collection of IEnumerable<string>
var dir = new DirectoryInfo(@"C:\")
.EnumerateDirectories()
.Where(x => x.Attributes.HasFlag(FileAttributes.Hidden))
.Select(x => x.Name);

foreach (var file in dir)
{
Console.WriteLine(file);
}

Console.ReadLine();
}

VB.NET

Shared Sub Main(ByVal args() As String)
' dir is a collection of IEnumerable<string>
Dim dir = New DirectoryInfo("C:\")_
.EnumerateDirectories()_
.Where(Function(x) x.Attributes.HasFlag(FileAttributes.Hidden))_
.Select(Function(x) x.Name)

For Each file In dir
Console.WriteLine(file)
Next file

Console.ReadLine()
End Sub

OUTPUT

image

Popular .NET Web Content Management Systems (CMS) - Open Source

As wikipedia defines it - “A web content management (WCM) system is a CMS designed to simplify the publication of web content to web sites and mobile devices, in particular, allowing content creators to submit content without requiring technical knowledge of HTML or the uploading of files

Here are some good Open Source ASP.NET Web CMS that are popular in the community.

Update: Kentico has a free ASP.NET Web CMS too and can be downloaded over here


N2 CMS - N2 is a lightweight CMS framework to help you build great web sites that anyone can update. Using it's interface is intuitive and empowering. It is based on an object model with separation between view templates, content model and database and integrates well with the ASP.NET and ASP.NET MVC 2 paradigm.

image

Online Demo Feature Set Documentation Download Link License


DotNetNuke Community Edition - DotNetNuke, also known as DNN, is the ideal platform for building professional websites with dynamic content and interactive features. It is the most widely adopted Web Content Management Platform for building web sites and web applications on Microsoft .NET.

image

Online Demo Feature Set Documentation Download Link License


mojoPortal - mojoPortal is an extensible cross platform, cross database, content management system (CMS) and web application framework

image

Online Demo Feature Set Documentation Download Link License


Umbraco CMS - Umbraco is an open source Web CMS for .NET. Its flexible content model with full .NET integration, full control over markup and stellar user interface makes both editors, designers and developers smile.

image

Video Tour Feature Set Documentation Download Link License


TheBeerHouse CMS - TheBeerHouse is a website developed with Microsoft's MVC Framework which includes a number of features and modules that you expect from a typical CMS / e-commerce website, such as Membership, CMS, Opinion Polls, Mailing List, Forums and much more.

image

Online Demo Feature Set Download Link License


Kooboo CMS - Kooboo is a web CMS built based on ASP.NET MVC framework. It is designed for those organizations or people who need enterprise level content management and fast web development

image

Online Demo Quick Start Video Documentation Download Link License


My Web Pages Starter Kit - The My Web Pages Starter Kit is a dynamic content management system (CMS). It is designed to meet the needs of computer enthusiasts who want to deploy and maintain their own website – and it is also easy to modify the look and feel or even change/extend the feature set

image

Online Demo Feature Set Documentation Download Link License


Cuyahoga - Cuyahoga is a flexible CMS / Portal solution written in C#. It runs on both Microsoft .NET and Mono and uses NHibernate for persistence Multiple databases are supported

image

Feature Set Documentation Download Link License


So the next time you want to create a CMS without paying a dime, you would now know which ones to try out! You can Bookmark this link for future use.

7 New methods to Enumerate Directory and Files in .NET 4.0

.NET 4.0 introduces 7 new methods to Enumerate directories and files. All these methods return Enumerable Collections (IEnumerable<T>), which perform better than arrays.

Here are the 7 new methods:

Directory.EnumerateDirectories - Returns an enumerable collection of directory names in a specified path

DirectoryInfo.EnumerateDirectories - Returns an enumerable collection of directory information in the current directory

Directory.EnumerateFiles - Returns an enumerable collection of file names in a specified path

DirectoryInfo.EnumerateFiles - Returns an enumerable collection of file information in the current directory

Directory.EnumerateFileSystemEntries - Returns an enumerable collection of file-system entries in a specified path

DirectoryInfo.EnumerateFileSystemInfos - Returns an enumerable collection of file system information in the current directory

File.ReadLines - Reads the lines of a file

In my upcoming posts, I will show you how to use these new methods.

Render an ASP.NET Control but also Keep it Invisible

In order to hide a control, a lot of developers set the Visible property of the control to True. However what this does is that it does not Render the control, so you cannot set a value to the control.

If you want to Render the Control and also keep it invisible at the same time ‘programmatically’, use the CssStyleCollection. So for example, if you have three textboxes tbOne, tbTwo, tbThree and want to render the textbox tbTwo but keep it invisible, use the following code

tbTwo.Style.Add(HtmlTextWriterStyle.Display, "none");

What this essentially does is that it sets the display style of the textbox to none.

image

Note: You could have declared a Css class and then set the TextBox CssClass to it, but I wanted to demo an example that can be done programmatically at server side.

Round off Decimal to 2 places in jQuery

I was recently working on a requirement where a textbox value had to be rounded off to 2 decimal digits and ‘$’ appended in front of it. Here’s how to achieve it

<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Round to 2 Decimal Places</title>
<
script type="text/javascript"
src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js">
</
script>
<
script type="text/javascript">
$(function() {
$('input#txtNum').blur(function() {
var amt = parseFloat(this.value);
$(this).val('$' + amt.toFixed(2));
});

});
</script>
</
head>
<
body>
Type a decimal number in the TextBox and hit Tab
<br />
<
input id="txtNum" type="text" />
</
body>
</
html>

Here we use the toFixed() which Formats a number using fixed-point notation. The number is rounded if necessary, and the fractional part is padded with zeros if necessary so that it has the specified length.

image

After the TextBox loses focus

image

See a Live Demo

Free Open Source UML Tools

"UML is not dessert topping and floor wax." - Grady Booch on the versatility of UML.

UML as you know, includes a set of graphic notation techniques that helps you specify, visualize, and document models of software systems, including their structure and design, in a way that meets all of these requirements. There are many popular professional diagramming tools like Visio available in the market. Depending on your need, sometimes you don’t really need commercial tools to generate UML diagrams. This article contains some Good Open Source UML tools that might do the job for you for free.

StarUML - StarUML is an open source project to develop fast, flexible, extensible, featureful, and freely-available UML/MDA platform running on Win32 platform. The goal of the StarUML project is to build a software modeling tool and also platform that is a compelling replacement of commercial UML tools

Check it’s features here

image
ArgoUML - ArgoUML is the leading open source UML modeling tool and includes support for all standard UML 1.4 diagrams. It runs on any Java platform and is available in ten languages.

Check its features here.

image
Violet UML Editor - Draws nice-looking diagrams. Completely free. Cross-platform.Violet is intended for developers, students, teachers, and authors who need to produce simple UML diagrams quickly.

Check its features here.

image
Astah Community 6.1 (Previously JUDE)- Based on the concept of "Usable from the moment of installation", the modeling features of astah community have been designed to be simple and user friendly.

Check its features here

image

BOUML - BOUML is a free UML 2 tool box allowing you to specify and generate code in C++, Java, Idl,Php and Python. BOUML runs under Unix/Linux/Solaris, MacOS X(Power PC and Intel) and Windows.

Check its features here.

image
UMLet 10.4 - UMLet is an open-source UML tool with a simple user interface: draw UML diagrams fast, export diagrams to eps, pdf, jpg, svg, and clipboard, share diagrams using Eclipse, and create new, custom UML elements. UMLet runs stand-alone or as Eclipse plug-in on Windows, OS X and Linux.

Check its features here

image
UMLGraph - UMLGraph allows the declarative specification and drawing of UML class and sequence diagrams. The current features are part of an ongoing effort aiming to provide support for all types UML diagrams.

Check its features here

image

Dia - Dia is a GTK+ based diagram creation program for GNU/Linux, Unix and Windows released under the GPL license. Dia is roughly inspired by the commercial Windows program 'Visio', though more geared towards informal diagrams for casual use. It can be used to draw many different kinds of diagrams.

Check its features here.

image

MetaUML - MetaUML is a GNU GPL MetaPost library for typesetting UML diagrams, using a human-friendly textual notation.

UML Modeling Tools for IDE’s

Here are some community edition modeling tools available for popular IDE’s.

Visual Paradigm SDE for Visual Studio - Smart Development Environment Community Edition for Visual Studio (SDE-VS CE) fully supports the latest version of UML. Open source projects' developers can use SDE-VS CE to design system with UML. SDE-VS CE is free non-commercial use only. SDE-VS is embedded in Visual Studio

Check its features here.

image

T4 Editor plus UML modeling Tools for Visual Studio (2008/2010) - Quickly write your own Code Generator via T4 Text-Templates (.tt-Files) with Intelli-Sense & Syntax-Highlighting. tangible T4 Editor also comes with UML-Style modelingtools and can generate from diagrams, database schemas, xml, word, excel sources, or any other data source. Microsoft T4 looks and smells like ASP.NET - it is simple!

Check its features here

image

NetBeans IDE UML - The UML plugin for the NetBeans IDE is available for version 6.7 and earlier releases.

Check its features here

image

Eclipse UML2 Tools - UML2 Tools is a set of GMF-based editors for viewing and editing UML models; it is focused on (eventual) automatic generation of editors for all UML diagram types

Check its features here

Some Online UML Diagram Generators

Here are some free web based diagram generators

WebSequenceDiagram - Just enter the description here, and click "draw"

yUML - Create and share simple UML diagrams in your blogs, wikis, forums, bug-trackers and emails

zOOml - zOOml.com is the Web 2.0 site for rapid object-oriented modeling. It's easy to create a model withzOOml.com's Modeler web application, a drawing tool for illustrating classes, associations and other concepts in OMG's UML modeling language.

Build Customization using Visual Studio 2010 (TFS 2010)

Gouri Sohoni has published a series of articles explaining Build Customization using Visual Studio 2010. These articles are very helpful for those who want to :

- explore new features provided for Build Management in Visual Studio 2010

- customize the default template and use it in build definition and how to create a new activity using activity library (with xaml) and

- create a custom activity using code and make it available in the toolbox with the help of activity library.

Check out these articles here:

Build Customization using Visual Studio 2010 – Explore New Features

Build Customization using Visual Studio 2010 – Customize the Default Template

Build Customization using Visual Studio 2010 (TFS 2010) - Creating Custom Activity

Ordering Elements of a List<String> by Length and Content

Here’s how to order the elements of a List<String> first by length and then by content

C#

static void Main(string[] args)
{
IEnumerable<string> newList = null;

List<string> strList = new List<string>()
{
"Jane", "Bandy", "Ram", "Fiddo", "Carol"
};

newList = strList.OrderBy(x => x.Length)
.ThenByDescending(x => x);

foreach (var str in newList)
Console.WriteLine(str);
Console.ReadLine();
}

VB.NET

Shared Sub Main(ByVal args() As String)
Dim newList As IEnumerable(Of String) = Nothing

Dim
strList As New List(Of String)() From _
{"Jane", "Bandy", "Ram", "Fiddo", "Carol"}

newList = strList.OrderBy(Function(x) x.Length)_
.ThenByDescending(Function(x) x)

For Each str In newList
Console.WriteLine(str)
Next str
Console.ReadLine()
End Sub

OUTPUT


image

You can also read Some Common Operations using List<string>

30 Favorite Visual Studio Keyboard Shortcuts

Here is a list of my favorite Visual Studio Keyboard Shortcuts that I use all the time to increase my productivity and perform repetitive tasks with ease. I have tested these shortcuts on VS 2010, but most of them work on VS 2008 too. You can bookmark this link and make them your favorites too!

Note: I am using the US Keyboard Layout!

Navigation Shortcuts



Ctrl + ]Moves the cursor to the matching brace in the source file
Ctrl + Hyphen (-) Moves cursor to its previous position
Ctrl + Shift + Hyphen (-)Moves cursor to the next browsed line of code
Shift + F7Switch between the Design and Source View of the document
Ctrl + TabDisplays the IDE Navigator with the current document selected. Allows you to navigate open documents. Also try Alt+W+2
Ctrl + Shift + FDisplays the ‘Find in Files’ tab of the ‘Find and Replace’ dialog box
Ctrl + IActivates Incremental Search by searching for the next occurrence of the input text. You can even use F3
Shift + F12Displays a list of all references for the symbol selected
Ctrl + /Moves focus to the Find/Command box



Editing Shortcuts



Ctrl + K + CComment a Line or an entire selected block
Ctrl + K + UUncomment a Line or an entire selected block
Ctrl + LCuts the current line
Ctrl + C, Ctrl + V Duplicate a line


Window Shortcuts



Shift + Alt + Enter Toggle Full Screen Mode
Ctrl + M + OCollapses all Regions to provide a high level overview of the types and members in the source file
Ctrl + M + LToggles all previously collapsed Regions
/Collapses all tabs in a Toolbox
*Expands all tabs in a Toolbox. If * does not work, use Shift + 8 for ENU keyboards as explained here
Shift + EscCloses the current Tool Window with focus


Code Completion Shortcuts



Ctrl + Period (.) Expands the Smart Tag Menu (Usually when you rename a method or need to add a ‘using’ statement). You can also use Alt+Shift+F10
Tab Inserts expanded code snippet using a shortcut (for example enter the keyword ‘class’ and hit Tab twice)
Ctrl + SpaceCompletes the current word in the completion list


Other Shortcuts



Ctrl + Shift + BBuild the solution. You can even try F6
F5Start the application with Debugging
Ctrl + F5Start the application without Debugging
F9Sets or Removes a breakpoint at the current line
Ctrl + Shift + SSave all unsaved files
Ctrl + Alt + LShow Solution Explorer
Ctrl + Shift + ADisplays the Add New Item dialog box
Alt + Shift + ADisplays the Add Existing Item dialog box

You can also download the Visual Studio 2010 Keyboard Shortcuts Poster

Expression Studio 4 Released

In the Internet Week- NY, Microsoft announced the general availability of Expression Studio 4 RTM. Expression Studio 4 includes Expression Blend (with SketchFlow), Expression Web (with SuperPreview), Expression Design and Expression Web.

Download the Expression Studio 4 Ultimate trial.

Note: If you already own a license of Expression Studio/Web 3, then you can upgrade to Expression 4 for free. Just download the trial and install it on top of Expression Studio/Web 3. The installer will automatically detect the license and upgrade it for free.

Check the video here to find out what’s new in Expression Studio 4 Ultimate

Get Microsoft Silverlight

You can check a breakdown of the new features at Tim Heuer’s Blog.

Remove Links and Display Text using jQuery

Here is a simple example of how to remove all links on a page and display Text instead

<html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
title>Remove Links</title>
<
script type="text/javascript"
src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js">
</
script>
<
script type="text/javascript">
$(function() {
$('#btnRemove').click(function() {
$('a').contents().unwrap();
});
});
</script>
</
head>
<
body>
My Sites: <br /><br />
<
a href="http://www.dotnetcurry.com">DotNetCurry</a><br />
<
a href="http://www.devcurry.com">DevCurry</a><br />
<
a href="http://www.sqlservercurry.com">SQLServerCurry</a><br />
<
br />
<
input id="btnRemove" type="button" value="Remove Links" />
</
body>
</
html>

Before

image

After clicking the Button

image


See a Live Demo

Developing Windows Azure Applications - Security Best Practices

Microsoft recently released a whitepaper on Security Best Practices For Developing Windows Azure Applications

This paper focuses on the security challenges and recommended approaches to design and develop more secure applications for Microsoft’s Windows Azure platform. Microsoft Security Engineering Center (MSEC) and Microsoft’s Online Services Security & Compliance (OSSC) team have partnered with the Windows Azure team to build on the same security principles and processes that Microsoft has developed through years of experience managing security risks in traditional development and operating environments.”

This paper is intended to be a resource for technical software audiences: software designers, architects, developers and testers who design, build and deploy more secure Windows Azure solutions.

Download Link

Collection of .NET Framework and Visual Studio Posters

Here is a collection of .NET Framework and Visual Studio Posters available for free. The .NET Framework posters can be kept on your wall as quick references that you'll use again and again to find important class library details and relationships in the .NET Framework. The Visual Studio posters can help increase productivity when performing certain tasks within the Visual Studio IDE.

You can bookmark this link for future reference.

Visual Studio 2010 Keybinding Cards - A high quality, print-ready PDF containing the default keybindings in Visual Studio 2010 for Visual Basic, Visual C#, Visual C++ and Visual F#.

.NET Framework 4.0 Namespaces and Types Poster – A high quality, print-ready PDF containing .NET Framework 4.0 important Namespaces and Types.

.NET Framework 3.5 Common Namespaces and Types Poster - The .NET Framework 3.5 Common Namespaces and Types Poster is downloadable as XPS or PDF format.

.NET Framework 3.0 Namespaces and Types Poster - A high quality, print-ready PDF containing .NET Framework 3.0 important Namespaces and Types

Visual C# 2008 Keybinding Reference Poster - A high quality, print-ready PDF containing the useful keybindings for developers that choose the C# developer profile in Visual Studio 2008 or use Visual C# Express

Visual Basic 2008 Keybinding Reference Poster - A high quality, print-ready PDF containing the useful keybindings for developers that choose the Visual Basic developer profile in Visual Studio 2008 or use Visual Basic Express.

Visual C++ 2008 Keybinding Reference Poster - A high quality, print-ready PDF containing the useful keybindings for developers that choose the Visual C++ developer profile in Visual Studio 2008 or use Visual C++ Express

Visual C# 2005 Keyboard Shortcut Reference Poster - This poster contains the default keybindings for Visual C# 2005, and is available as a PDF download in either color or grayscale for you to print.

Visual Basic 2005 Keyboard Shortcut Reference Poster - This poster contains the default key bindings for Visual Basic 2005, and is available as a PDF download in either color or grayscale for you to print

Visual C++ 2005 Keyboard Shortcut Reference Poster - This poster contains the default keybindings for Visual C++ 2005, and is available as a PDF download in either color or grayscale for you to print.

Save Trees. Print these documents only when necessary. Thanks!