Visual Studio Magazine - 03- 2009.pdf

Embed Size (px)

Citation preview

  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    1/44

    MARCH2

    009

    Vol.19,No.3

    GETTING DIRECTIONS.NET developers face adjustmentsas they start coding for Microsoftshigh-flying collaboration platform.

    VisualStudioMagazine.com

    The Art of the Interview

    E N T E R P R I S E S O L U T I O N S F O R . N E T D E V E L O P M E N T

    Generate Code fromCustom File Formats

    Create Anonymous Types

    +

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    2/44

    http://www.microsoft.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    3/44

    http://www.microsoft.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    4/44

    programmersparadise.com800-445-7899

    Your best source forsoftware development tools!

    Prices subject to change. Not responsible for typographical errors.

    programmers.com/theimagingsource

    Download a demo today.

    BestSeller!

    Professional EditionParadise #

    T79 02101A01

    $919.99

    programmers.com/mindjet

    for Windows1 User

    Paradise #F15 17301A02

    $299.99

    NewRelease!

    Mindjet MindManager 8by Mindjet

    Do you harness the wealth of data,Web pages, and other input that comesyour way every day? Is there a way touse it more effectively to formulate newideas, sharpen your focus, and ultimatelydrive your success? New MindManager 8for Windows is the answer.

    Unlike the usual linear-based approach ofmost productivity tools, MindManager 8uses mind-mapping technology to let youcapture, organize, and communicateinformation using an intuitive visualcanvas. Youll be able to work smarterand transform your ideas into actionmore quickly.

    .NET WinForms control for VB.NET and C#

    ActiveX for VB6, Delphi, VBScript/HTML, ASP

    File formats DOCX, DOC, RTF, HTML, XML, TXT

    PDF export without additional 3rd partytools or printer drivers

    Nested tables, headers & footers, textframes, bullets, numbered lists, multipleundo/redo, sections, merge fields

    Ready-to-use toolbars and dialog boxes

    TX Text Control 14Word Processing Components

    TX Text Control is royalty-free,robust and powerful word processingsoftware in reusable component form.

    programmers.com/telerik

    Telerik RadControlsby Telerik

    Add grid, combo, editing, navigation and chartingfunctionality to your AJAX and ASP.NET projects.RadControls for ASP.NET enhances your Webapplications by adding AJAX functionality to yourASP.NET projects. The suite takes full advantageof the features included in Visual Studio 2005.RadControls for ASP.NET helps developers deliverfeature-rich, standards-compliant (WAI-A, WCAG1.0, XHTML 1.1) and cross-browser compatibleWeb applications, while significantly cuttingtheir development time. RadControls for ASP.NETincludes: RadEditor, RadTabstrip, RadInput,RadCalendar, RadUpload, RadWindow, RadAjax,RadGrid, RadCombobox, RadMenu, RadSpell,RadChart, RadTreeview and more.

    Single DeveloperParadise #

    TB3 01101A01

    $615.99

    programmers.com/slickedit

    SlickEdit 2008for Windowsby SlickEdit

    SlickEdit 2008 is a cross-platform, multi-lan-guage code editor that gives programmers theability to code in over 40 languages on 7 plat-forms. This latest version builds on the compa-nys 20 years of experience in enabling devel-opers and development teams to create, navi-gate, modify, build, and debug code faster andmore accurately.

    Paradise #M39 19201A01

    $242.99

    programmers.com/farpoint

    FarPoint Spreadfor Windows FormsThe Best Grid is a Spreadsheet. Give your usersthe look, feel, and power of Microsoft Excel,without needing Excel installed on their machines.Join the professional developers around theworld who consistently turn to FarPoint Spreadto add powerful, extendable spreadsheet solu-tions to their COM, ASP.NET, .NET, BizTalk Serverand SharePoint Server applications.

    Worlds #1 selling development spreadsheet

    Read/Write native Microsoft Excel Files

    Cross-sheet formula referencing

    Fully extensible models

    Royalty-free, run-time free

    Paradise #F02 01101A01

    $936.99

    dtSearch Engine for Win & .NETAdd dtSearchs blazing speeds(CRN Test Center) searching andfile format support

    dozens of full-text and fielded

    data search options file par sers/converters for hit-highlighted

    display of all popular file types

    Spider supports dynamic and static web data;highlights hits with links, images, etc. intact

    API supports .NET, C++, Java, SQL and more;new .NET Spider API

    Bottom line: dtSearch manages a terabyte oftext in a single index and returns results inless than a second. InfoWorld

    programmers.com/dtsearch

    Single ServerParadise #

    D29 02101A07

    $949.99

    New64-bit

    Version!

    programmers.com/sparxsystems

    New

    Release!

    Enterprise Architect 7.1Visualize, Document andControl Your Software Project

    by Sparx Systems

    Enterprise Architect is a comprehensive,integrated UML 2.1 modeling suiteproviding key benefits at each stage ofsystem development. Enterprise Architect7.1 supports UML, SysML, BPMN andother open standards to analyze, design,test and construct reliable, well under-stood systems. Additional plug-ins arealso available for Zachman Framework,MODAF, DoDAF and TOGAF, and tointegrate with Eclipse and Visual Studio2005/2008.

    Corporate Edition1-4 Users

    Paradise #SP6 0001

    $182.99

    programmers.com/multiedit

    Multi-Edit 2008by Multi Edit Software

    Multi-Edit 2008 delivers, a powerful IDE,with its speed, depth, and support forover 50 languages. Enhanced searchfunctions include Perl 5 RegularExpressions and definable filters.Supports large DOS/Windows, UNIX,binary and Mac files. File SyncIntegration for: Delphi 6, 7, 2005,C++Builder 6, BDS 2006 and RadStudio2007, VB 6, VC 6, VS 2003 & VS2005. Includes file compare, codebeautifying, command maps, andmuch more.

    1-49 UserParadise #

    A30 01201A02

    $161.99

    NewRelease!

    programmers.com/lead

    LEADTOOLS DocumentImaging v 16:by LEAD Technologies

    LEADTOOLS Document Imaging has every

    component you need to develop powerfulimage-enabled business applications includingspecialized bi-tonal image display andprocessing, document clean up, high-speedscanning, advanced compression (CCITTG3/G4, JBIG2, MRC, ABC) and more. Multi-threaded OCR/ICR/OMR/

    MICR/Barcodes (1D/2D) Forms recognition/processing PDF and PDF/A Annotation (Image Mark-up) C/C++, .NET, WPF - Win32/64

    Paradise #L05 03201A01

    $2,007.99

    programmers.com/pragma

    Pragma Fortress SSHSecure Connectivityby Pragma Systems

    Pragma Fortress SSH provides a comprehensivesecure connectivity framework for enterprisecustomers.

    Full-featured server, graphical clients and graphicalmanagement capabilities are all included.

    Pragma Fortress SSH provides:

    GSSAPI Kerberos & NTLM authentication

    Accelerated SFTP & SCP file transfer

    Supports over 1000 sessions

    Runs console applications & allows historyscroll back within the same session

    Paradise #P35 0439

    $550.99 programmers.com/faircom

    c-treeACE Professionalby FairCom

    The c-treeACE database engine is a high performance

    database alternative proven by developers in missioncritical enterprise systems, desktop deployments, andembedded devices for over 25 years.

    Complete set of APIs including ADO.NET, LINQ,C#, C/C++, ODBC, JDBC, VCL, and dbExpress

    Graphical productivity tools

    Simple deployment

    No DBA or ongoing administration

    Low deployment licensing costs Cross-platform support for all major platforms

    including Windows, UNIX, Linux, and Mac OS X

    Make your applications faster, easier to deploy,and more affordable with c-treeACE.

    Paradise #F01 0131

    $711.99

    programmers.com/vmware

    View PremierParadise #

    V55 66101A01

    CALLI

    VMware View PremierStarter KitView Premier is an Enterprise-classDesktop and Application virtualizationsuite that enables you to take control

    of your desktops and applications whileproviding storage optimization. TheStarter Kit is the entry level solutionthat includes 10 concurrent user licensesof VMware Infrastructure Enterprise,vCenter Foundation, ThinApp, ViewComposer and View Manager. SnSis required and sold separately.

    VDI Included

    NewRelease!

    http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/http://www.waysidetechnology.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    5/44

    www.visualstudiomagazine.com March 2009 VISUAL STUDIO MAGAZINE 3

    COLUMNS

    C# CORNER

    32 Create Anonymous TypesTaking a careful look at the capabilities the

    compiler gives to anonymous types provides an

    excellent tutorial on what you should consider

    when you create your typesincluding whether

    they are classes or structs. BY BILL WAGNER

    DEPARTMENTS

    6 Editors Note BY MICHAEL DESMOND

    8 Letters to the Editor

    10 First LooksProduct Listings . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    Review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    39 Index of Advertisers

    40 The Pragmatic DeveloperThe Art of the Interview BY BILLY HOLLIS

    FEATURES

    12 Getting Directions.NET developers face adjustments as they start coding for

    Microsoft's high-flying collaboration platform.

    BY MICHAEL DESMOND

    18 Generate Code from Custom

    File FormatsCreate a custom tool to provide a flexible and easy way

    to generate code on demand. BY PETER VOGEL

    12

    .NET and ASP.NET developersworking with SharePoint must

    be ready to do thingsthe SharePoint way.

    Michael Desmond, Getting Directions p. 12

    COVERC

    OMPOSITE

    IMGAES

    FROMI

    STOCKPHOTO.COM

    ContentsMarch 2009 VOLUME 19 NO. 3

    32

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    6/44

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com4

    LEARN FROM THE PROSAs a developer you are constantly facing the

    problem of how to keep up with all the new

    technologies being released while still get-

    ting your job done. You keep hearing about

    solutions to your programming problems but

    the question is: are they the right solutions

    for your particular needs? You could spend

    hours or even days trying to find the

    answers yourself, or you could let the

    experts do it for you. Redmond Media Group

    Events offers a variety of conferences andshows where you can learn about new tech-

    nologies and what they might offer you, attend in-depth workshops that

    focus on topics specific to your needs, ask questions of the experts, and

    interact with your peers to discuss problems they face and what solutions

    theyve come up with. Whether its Web design, .NET development, or SQL

    Server programming, weve got an event that matches your needs. Visit

    RedmondEvents.com to learn more about upcoming conferences and shows.

    ONLINE ARTICLES

    Practical ASP.NET:

    Accessing Connection Strings Reliably

    In his ongoing series on ASP.NET, Peter Vogel provides an alternative tothe default mechanism for accessing connection stringand plugs his

    next book. LOCATOR+ CODE: VS0903PV1

    Practical ASP.NET:

    Updating Multiple GridView RowsPeter Vogel explains how putting updateable controls in the

    ItemTemplate in a GridView gives developers what they want: the ability

    for users to change more than one row at a time. The cost is writing

    some extra code. LOCATOR+ CODE: VS0903PV2

    ONLINE TUTORIALS

    Classic VB Corner:Let Me Tell Ya Where to Stick ItIn these days of increasingly common least-privileged users, where

    should you store your application data? Karl E. Peterson drills down on

    the best approaches to organizing and accessing your system folders.

    LOCATOR+ CODE: VS0903KP1

    OnlineCheck out these and other exclusive online articles and tutorials on the Visual Studio Magazine Web site at

    VisualStudioMagazine.com

    ContentClassic VB Corner:

    Forward CompatibilityDoes anyone really expect to be able to take data from

    the current version of AppX and use it freely in the

    previous version of AppX? Of course not! Karl E. Peterson

    discusses forward compatibility and how data assets

    simply must move forward from one version of an

    application to the next. LOCATOR+ CODE: VS0903KP2

    GIVE US YOUR FEEDBACKWe at Visual Studio Magazineand VisualStudioMagazine.com

    are constantly trying to improve the content we provide you

    and the way that content is presented, both in the pages of

    the magazine and online. We value your opinions about any

    aspect of the magazine or our Web site. If you have any

    comments, criticisms, or suggestions on how we might

    improve things please feel free to contact us. You can reach

    us by email at [email protected] orgo online at

    VisualStudioMagazine.com and post your comments.

    What Are Locator+ Codes?Locator+ codes give you instant access to a feature on Visual

    Studio Magazine Online. Simply type the Locator+ code into

    the field in the upper-right corner and click on FIND IT.

    .NET NEWSLETTER SIGN-UP

    Every week, the .NET Insight e-mail newsletter brings you up-to-date news, technical information, opinions,

    interviews, and analysis on topics and technologies such as Visual Basic .NET, C#, SQL Server and data access,

    ASP.NET, wireless, Web services, and XML. Sign up for free at VisualStudioMagazine.com.

    VirtualizationReview.com1105 Media recently launched a new Web site devoted

    exclusively to covering all aspects of IT virtualization.VirtualizationReview.com helps you harness the power of

    virtualization by delivering news and in-depth coverage of

    the products, vendors, issues, and technologies transform-

    ing IT through virtualization. The site also features articles,

    tips, and timely information about all aspects of virtualiza-

    tion including servers, storage, desktops, applications, and

    more. Visit VirtualizationReview.com now to start your

    move to a more efficient, powerful virtual environment.

    http://www.visualstudiomagazine.com/mailto:[email protected]://www.visualstudiomagazine.com/mailto:[email protected]
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    7/44

    Integrate Mapping and GIS into Your Applications

    Give your users an effective way to visualize and analyze their data so they can make more informed

    decisions and solve business problems.

    By subscribing to the ESRI Developer Network (EDNSM), you have access to the complete ESRI

    geographic information system (GIS) software suite for developing and testing applications on

    every platform. Whether youre a desktop, mobile, server, or Web developer, EDN provides the

    tools you need to quickly and cost-effectively integrate mapping and GIS into your applications.

    Copyright 2009 ESRI. All rights reserved. The ESRI globe logo, ESRI, EDN, and www.esri.com are trademarks, registered trademarks, or service marks of ESRI in the United States, the European Community, or certain

    other jurisdictions. Other companies and products mentioned herein may be trademarks or registered trademarks of their respective trademark owners.

    Subscribe to EDN and leverage the power of GIS to get

    more from your data. Visit www.esri.com/edn.

    http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/http://www.esri.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    8/44

    EditorsNote

    BY MICHAEL DESMOND

    editor in chief

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com6

    By now youve no doubt noticed some changes in this months issueofVisual Studio Magazine.

    Theres a lot going on at VSMas we work to improve the pub-

    lication, and were anxious to let you know what were up to,

    and to hear your opinions about what we might do better.

    Its probably best if I start at the top.Back in January our

    parent company,1105 Media Inc.,announced that it was

    merging its two developer publicationsVSMand the twice-monthly Redmond Developer Newsinto a single,integrated

    publication under the title Visual Studio Magazine. The move

    blends the best aspects of each magazine,combining VSMs

    detailed how-to content and coding tutorials and RDNs in-

    depth analysis of key issues and technologies.

    In a sense, RDN and VSMhave been two sides of the

    same coin. RDNgave developers fair warning of what was

    coming,be it new technologies or newly discovered chal-

    lenges,and VSMshowed them how to work with it.

    Now these two missions are being united under the VSM

    banner.The move reflects the fact that developers need con-

    text.They need to know about the tools theyre mastering,sothey can make better decisions on how to use them. To that

    end, future issues ofVSMwill deliver the kind of in-depth

    features, timely technology and product news, plus expert

    insight that youve seen in RDN since 2006.

    The transition brings significant changes to the VSM

    staff. I want to take a moment to recognize the outstanding

    efforts of former VSMEditor in Chief Patrick Meader and

    Managing Editor Guy Wright,who are both moving on from

    VSMas part of the transition. Ive worked on occasion with

    Patrick over the past two years, and Ive respected him deeply

    for his intelligence, composure and commitment to princi-

    ple. Patrick is as dedicated and forthright a person as Ive ever

    run across in my 16 years in IT publishing,and his successover the years at VSMis testament to that.

    Joining the VSMteam are three new faces.Kathleen

    Richards is the new executive editor and will guide many of

    the key how-to departments and features at the magazine.

    Richards was senior editor at RDNand before that at Appli-

    cation Development Trends magazine. Jeffrey Schwartz

    arrives as news editor,where hell drive the front-of-the-book

    news and review content. Schwartz comes to VSM fromRDN,

    where he managed the books large news section. Prior to that

    he was a senior editor at VAR Business.

    As for myself,Ive moved over as editor in chiefofRDN

    to serve as editor in chief ofVSM.

    What does it all mean? Quite a lot,actually. The new staff

    reflects an expanding mission for VSM. The magazine will

    continue to publish cutting-edge tutorial and how-to con-

    tent,but our coverage will expand to include issue-oriented

    features, timely news analysis and incisive commentary.

    Developers working with tooling as expansive and as power-ful as Visual Studio dont work in a vacuum, and Visual Studio

    Magazinewill reflect that.

    This issue is really the first step in the effort to broaden

    the scope and reach ofVSM. In April, we plan to unveil

    a redesigned publication that is fully aligned with our

    expanded vision.

    I want to emphasize that Visual Studio Magazineis here

    to serve you.With so many big and exciting changes afoot,

    were more anxious than ever to hear the opinions and input

    of developers and managers.What can we do to improve

    VSM? What kinds of stories, content,tutorials and interac-

    tion are you looking for? And how can these things be tunedto help you do your jobs better? We want to hear your ideas

    e-mail me at [email protected].

    PHOTOBYIRAWYMAN

    WHAT HAPPENS NEXT

    http://www.visualstudiomagazine.com/mailto:[email protected]://www.visualstudiomagazine.com/mailto:[email protected]
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    9/44

    WinForms WPF ASP.NET Silverlight iPhone Mobile ActiveX

    Grids Charting Reporting Scheduling Menus and Toolbars Ribbon Data Input Editors PDF

    STUDIO FOR SILVERLIGHT

    STOCKPORTFOLIO DEMO STUDIO FOR IPHONE

    CTP NOW AVAILABLE

    Studio for SilverlightProduce limitless RIAs: state-of-the-art Silverlight controls

    Find the Silverlight 2 control you need to build rich data apps:

    largest selection of Silverlight controls including unique

    controls like animated GIFs, sp ell-checking, file uploader,

    and more

    Increase functionality with a small footprint: averagecontrol size of 77KB (XAP size) eliminates the need to worry

    about adding to the size of the download

    Access the best resources: 15+ samples with source code

    for quick learning

    Studio for ASP.NETAJAX-enabled controls for desktop-like experience on the Web

    Build lightweight, high-performance Web apps: 3x

    smaller footprint, 10x faster performance

    Style and animate your Web UI without coding: dozens

    of built-in visual styles & animation effects

    Studio for iPhoneBuild Web apps that look and feel like the native UI of t he iPhone and iPod touch

    Develop without the hassle of learning a new technology:

    Studio for iPhone controls are built on the familiar

    ASP.NET Framework

    Studio Enterprise 2008 v3 deliversexactly what you need to produce

    next-generation UIs for the Web.

    www.componentone.com/amazingwebGET STARTED TODAY DOWNLOAD YOURFREE TRIAL at

    ComponentOne Sales 1.800.858.2739 or 1.412.681.4343 1987-2009 ComponentOne. All rights reserved. iPhone and iPod are trademarks of Apple Inc. All

    product and brand names are trademarks and/or registered trademarks of their respective holders.

    Visit Us at VSLive!Febuary 23rd-25 th at booth #328-330

    http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/http://www.componentone.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    10/44

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com8

    Letters to Visual Studio Magazine are

    welcome. Letters must include your

    name, address and daytime phone

    number to be considered for publica-

    tion. Letters might be edited for form,

    fit and style. Letters express the views

    of the individual authors, and do not

    necessarily reflect the views of the

    editors, VSM or 1105 Media. Please

    send them to Letters to the Editor, c/o

    VSM, 16261 Laguna Canyon Road

    Ste. 130 Irvine, Calif. 92618; fax

    them to 949-265-1528; or e-mail

    them to [email protected].

    Letters

    Agile Arguments

    Billy Hollis The Pragmatic Developer column (Is Agile Rock or Disco? January

    2009) brings an interesting point to light: Will Agile survive the times?

    However, I think the author missed a different, critical point: Agile is a mindset and not

    a process. Truly Agile development is adaptable, and therefore it can work with non-

    seasoned developers.

    Ted Malone,

    Colorado Springs, Colo.

    Id like to further a point Hollis made in his article: Its hard to do anydevelopment without

    good developers. Instead of trying to figure out how to make do with not-so-good developers,we need to figure out how to turn those with potential into good developers, and how to

    encourage the rest to find a more suitable field in which to work.

    The so-called software crisisa shortage of good developers compared to the amount

    of software that needs to be writtenis an issue of supply and demand. Theres an inherent

    undersupply of good developers, but theres also an oversupply of demand as many clients

    just want variations on the same thing. If its more profitable to be a good developer, those

    good developers will also create frameworks and tools to help address the demand-side prob-

    lems as well.

    Anonymous,

    Posted online

    WF: Change for the Worse?I suppose out of all the possible changes that might trouble me in Windows Workflow

    Foundation (WF) 4.0as discussed by Kathleen Dollard in her Ask Kathleen column

    (Windows Workflow Changes Direction, January 2009)the loss of the code activity is the

    most upsetting. This makes the possibility of making lightweight WF activities that accom-

    plish relatively simple tasks more difficult than necessary. By removing this piece of function-

    ality, Microsoft has effectively shackled the developer to creating activity libraries. While that

    has its place, this seems like the pendulum swinging way too far in the other direction.

    And frankly, I disagree with Dollard that moving completely to declarative creation of

    workflows is a good thing. Performance improvements are great, but performance improve-

    ments that cause the loss of very useful functionality are just wrong.

    Marcelo Lopez, Jr.,

    Florida

    VisualStudioMagazine.comMarch 2009 Volume 19 No. 3

    Editorial Staff

    Vice President, Doug BarneyEditorial Director

    Editor in Chief Michael Desmond

    Executive Editor Kathleen Richards

    News Editor Jeffrey Schwartz

    Managing Editor Wendy Gonchar

    Associate Managing Editor Katrina Carrasco

    Contributing Editors

    Andrew J. Brust, Ken Cox, John Cronan, Dan Fergus,

    John Gavilan, Roger Jennings, Don Kiely,

    Martin Kulov, Jeff Levinson, Bill McCarthy,

    John Charles Olamendy Turruellas, Keith Pleas,

    Peter Varhol, Bill Wagner

    Art Staff

    Creative Director Scott Shultz

    Graphic Designer Erin Horlacher

    Online/Digital MediaEditor, VisualStudio Becky NagelMagazine.com

    Executive Editor, New Media Michael Domingo

    Online News Editor Kurt Mackie

    Associate Editor, Web Gladys Rama

    Web Producer Shane Lee

    Director, Web Development Rita Zurcher

    President Henry Allain

    Vice President, Publishing Matt N. Morollo

    Director of Marketing Michele Imgrund

    Online Marketing Director Tracy S. Cook

    President & Neal VitaleChief Executive Officer

    Senior Vice President Richard Vitale& Chief Financial Officer

    Executive Vice President Michael J. Valenti

    President, 1105 Events Dick Blouin

    Vice President, Finance Christopher M. Coates& Administration

    Vice President, Digital Media, Abraham M. LangerAudience Development

    Vice President, Information Erik A. LindgrenTechnology &Web Operations

    Vice President, Digital Media, Doug MashkuriAdvertising

    Vice President, Carmel McDonaghAttendee Marketing

    Chairman of the Board Jeffrey S. Klein

    REACHING THE EDITORS

    Editors can be reached via e-mail, fax, telephone or mail.A list of editors and contact information is available atVisualStudioMagazine.com.

    E-mail: E-mail isrouted to individuals desktops. Please use thfollowing form: [email protected] not include a middle name or middle initials.

    Telephone: The switchboard is open weekdays 8:30 a.m.to 5:30 p.m. Pacific Time. After 5:30 p.m. you will be directedto individual extensions.

    San Francisco Office 415-814-0950; Fax 415-814-0961

    Irvine Office 949-265-1520; Fax 949-265-1528

    Corporate Office 818-734-1520; Fax 818-734-1528

    Visual Studio Magazine

    The opinions expressed within the articles and other contentherein do not necessarily express those of the publisher.

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/mailto:[email protected]:[email protected]:[email protected]://www.visualstudiomagazine.com/mailto:[email protected]:[email protected]
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    11/44

    For maximum efficiency, follow ourthree profiling tips outlined below.1. Profile your .NET code

    A code profiler is an essential

    tool to have in your development

    toolkit. Although manual logging

    can sometimes help, it is often

    impossible to find performance

    bottlenecks without a code profiler.

    A profiling tool takes the guesswork

    out of performance analysis and

    drastically reduces the amount of

    time taken to find problem code.

    2. Quickly locate your

    performance bottleneck

    Run ANTS Profiler Pro to obtain

    detailed quantitative data that will

    help you identify inefficient resource

    usage. ANTS Profiler gives you hit

    count and line-level timings, so you

    can quickly identify the specific

    lines of code which are affecting the

    performance of your application.

    No time wasting. No guessing.

    Use real data instead!

    3. Optimize efficiently

    Now that you know exactly where

    to focus your performance-boosting

    work, you can start optimizing your

    code effectively. Optimize your code

    only where it needs to be improved,

    and don't try to make unnecessary

    changes that will not solve your

    performance problem.

    How to boost the performance of your

    .NET applications with ANTS Profiler

    Performance is crucial, so here are some tips to make sure

    that your applications run efficiently.

    Download your 14-day, fully functionalfree trial from www.red-gate.com

    ANTS Profiler shows you line-level timings, so you can drill down to the specific lines of code responsiblefor performance inefficiencies.

    Select a region on the timeline and get the performance data just for that region.

    "We were able to improve

    performance in parts of

    the application up to 10 times,

    and our customer noticed the

    results. A powerful, instantly

    understandable profiler.Highly recommended."

    Dan Ports Lead Developer, Intrigma Inc

    "ANTS Profiler took us

    straight to the specific areas

    of our code which were the

    cause of our performanceissues."

    Terry Phillips Sr. Developer,

    Harley-Davidson Dealer Systems

    http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/http://www.red-gate.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    12/44

    LooksFirst

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com10

    P R O D U C T L I S T I N G S + R E V I E W S

    C

    Coverity PreventCoverity Inc. has improved the support for man-

    aged and native code in its static-analysis soft-

    ware. With Coverity Prevent, developers can

    automatically scan and analyze C#, C, C++ and

    Java source code on their desktops or on the

    build server. Its one of the few static-analysis

    tools that supports both Visual Studio and

    Eclipse integrated dev environments.

    The product ships with a Web server, which

    connects to the help desk or Active Directory

    server on your network and a back-end data-

    base. Developers open the Coverity browser

    and log on to the Web service. Prevent builds

    the source code, analyzes it based on selectedquality and concurrency checkers, and then

    commits the results to the database. A build-

    utility wrapper wraps around the build but

    doesnt change it. Depending on the number of

    checkers, the build and analysis typically take

    three to five times the normal build time.

    After a run, developers can view a break-

    down of the code base in the browser: how

    many files and lines of code, the number of new

    defects since the last Run ID, and outstanding

    defects that still need to be inspected and clas-

    sified. Developers cant edit the code from with-

    in the Prevent interface, however.

    The latest version beefs up VS integration,

    enabling developers to perform static analy-

    sis from within VS 2005 and VS 2008. The

    company has also added support for Windows

    Vista, Windows Mobile, Windows Automotive

    and Xbox.

    In addition, Coverity has extended Pre-

    vents C# functionality with new quality and

    concurrency checkers. Prevent is the first

    product to support C# concurrency testing for

    issues such as deadlocks and race conditions,

    according to the company. With this upgrade,

    Coverity Prevent and Quince UXPatterns Explorer

    it also now offers concurrency modeling to

    help developers find critical defects in multi-

    threaded Win32 apps.

    Prevent is the flagship product in Coveritys

    Software Integrity Suite, and the only product

    that currently supports C#. Upcoming static-

    analysis tooling will take advantage of

    Microsofts efforts to put annotations into its

    system header files.

    Coverity Prevent

    Coverity Inc.

    Price: Contact vendor for pricing

    Web: www.coverity.com

    Phone: 800-873-8193;415-321-5237

    Quince UXPatterns ExplorerComponents vendor Infragistics

    Inc. has launched a unique Sil-

    verlight 2 application called

    Quince UX Patterns Explorer.

    The app offers developers a

    resource for best practices in

    user experience design and user interface

    patterns. With Quince, developers can hone

    their UI design skills with guidance from the

    community-driven catalog by seeing what pat-

    terns other practitioners have used and by

    viewing developer feedback. Developers can

    also share and upload their own UI patterns.

    Quince offers guidance on common patterns

    for complex data entry, label alignment and

    navigation, among other UI tasks. The library is

    initially based on tools and practices that the

    20-year-old company uses internally, as well

    as expertise garnered from industry sources.

    Quince aggregates close to 100 patterns

    and shows implementations via a carousel

    format on various platforms, including

    ASP.NET, Windows Forms and PHP. Develop-

    ers can search Quince for commonly used pat-

    terns based on end user tasks, wireframe map

    locations and tags. The patterns catalog is set

    up so that the community can comment on

    patterns and their experiences in real time.

    The patterns are aggregated based on com-

    munity feedback.

    Yahoo! Inc. and Google Inc. offer pattern

    libraries, but there isnt a de facto resource in

    the .NET and Microsoft space .

    Quince

    Infragistics Inc.

    Price:No fees; registration required

    Web: www.community.infragistics.com/ux

    Phone: 888-448-0097; 609-448-2000

    Editors Note:Please send product information

    to New Products Editor, c/o VSM, 16261 Laguna

    Canyon Road, Ste. 130, Irvine, CA 92618;

    Phone: 949-265-1565, fax: 949-265-1528;

    e-mail: [email protected].

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.coverity.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/http://www.infragistics.com/mailto:[email protected]://www.visualstudiomagazine.com/mailto:[email protected]://www.coverity.com/http://www.infragistics.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    13/44

    P R O D U C T L I S T I N G S + R E V I E W S

    VisualStudioMagazine.com March 2009 VISUAL STUDIO MAGAZINE 11

    IIf you handle enterprise-level business intelli-

    gence (BI) and financial reporting, it wont be long

    before the front office summons you to deal with

    eXtensible Business Reporting Language (XBRL).

    XBRL is an XML vocabulary for exchanging busi-

    ness and financial data. Its a standard for

    machine-to-machine reporting thats been adopt-

    ed by the U.S. Securities and Exchange Commis-

    sion (SEC) and European authorities.

    Altova, well known for its leadership in all

    things XML, has updated its products to support

    XBRL and bundled them into MissionKit 2009 forEnterprise Software Architects. The goal is to give

    you the tools (but not necessarily the training) to

    deliver reports compliant with the International

    Financial Reporting Standards (IFRS).

    For XBRL beginners, it would have been ideal to

    have a hands-on walkthrough that starts with a

    financial database and ends with a valid XBRL doc-

    ument ready for submission to authorities. Alas,

    theres no XBRL For Dummies manual included.

    While each application includes tantalizing tidbits

    on working with XBRL, I felt like I was solving a jig-

    saw puzzle without seeing the entire picture first.XBRL is the buzz in Altovas all-in-one suite, but dont over-

    look the features that have long made the individual compo-

    nents the premier development environment in the XML space.

    Its hard to beat XML Spy as an all-round markup editor, validator

    and XPath query designer. Its Grid view is especially useful for

    collapsing and exploring very large documents. As you work, the

    Messages pane reports errors, explains the problem and high-

    lights the location. The other day, I fed XML Spy an XML file con-

    taining Expression Encoder ScriptCommands. XML Spy generat-

    ed a schema for it in an instant. Be careful what you ask for when

    converting an entire database into XML, though. I ended up with

    234 files while searching in vain for XML Spys cancel button.

    MapForce is Altovas flexible tool for mapping and filtering

    data graphically from one source to another. The source or tar-

    get can be a database, .EDI document, Web service, Excel 2007

    spreadsheet or a lowly .CSV file. MapForce will generate the C#

    classes you might need to automate data conversions.

    The third major component, StyleVision, lets you design XLST

    templates into which you pour data for human consumption. If

    youre getting into XBRL, be sure to explore the quarterly reportsample and the Word 2007 preview to see the richness of its

    output.

    One issue I encountered with MissionKit 2009 was preview-

    ing a stylesheet as a PDF. Even though I had chosen a ful l instal-

    lation, StyleVision strangely prompted me for a 19MB download

    of the Apache (Java) Formatting Objects processor. Even with

    that in place, the PDF document still failed to appear. I would

    expect Altovas setup kit to automatically install the rendering

    engine and tell its PDF module where to find it. VSM

    Ken Cox is a Canadian .NET programming writer and the author of

    ASP.NET 3.5 for Dummies (Wiley).

    Altova MissionKit Boasts XBRL Savvy

    PRODUCE READABLE FINANCIAL DOCUMENTS USING XSLT

    STYLESHEETS. StyleVision, a member of Altovas MissionKit 2009

    suite, lets you design human-readable documents from machine-to-

    machine files in XBRL format. The output options include HTML, RTF,

    PDF and Word 2007.

    AT A GLANCE

    MissionKit 2009 for Enterprise Software ArchitectsAltovaWeb: www.altova.comPhone:978-816-1600Price:$1,739Quick Facts: Integrated bundle of XML, database, XSLTdesigner, validation, and publishing tools with addedemphasis on financial reporting support.Pros:Handles all popular and emerging XML-basedtechnologies including the XBRL-compliance standard;extensive online documentation and Web-basedsupport; many examples.Cons:Needs end-to-end walkthrough on producingXBRL reports; rendering engine for previewing PDFdocuments not fully installed.

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.altova.com/http://www.visualstudiomagazine.com/http://www.altova.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    14/44

    S H A R E P O I N T

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com12

    F E A T U R E

    .NET developers face adjustments as they start coding for

    Microsofts high-flying workflow and collaboration platform

    BY MICHAEL DESMOND

    Getting Directions

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    15/44

    13

    S H A R E P O I N T

    Behind the activity is the wildfire growth

    of Microsofts file sharing, collaboration and

    portal platform, which includes Microsoft Office

    SharePoint Server (MOSS) 2007 and Windows

    SharePoint Services (WSS) 3.0 integrated into

    Windows Server.Last year,the SharePoint business

    unit surpassed 100 million licenses and $1 billionin total revenue, according to Microsoft. Now

    organizations are looking to leverage those invest-

    ments by adding custom functionality and applica-

    tions to their SharePoint infrastructure.

    That trend is producing its share of growing

    pains, as .NET dev shops contend with Share-

    Points unique demands and uneven tooling. At

    Microsofts TechEd Conference in June 2008,

    Chairman Bill Gates admitted during his keynote

    Q&A that the company had been caught flat-

    footed by the amount of development activity

    around SharePoint.At the time,he said Microsoftwas working to make SharePoint developers first-

    class citizens.

    Since then, Microsoft has released the free

    Visual Studio 2008 extensions for SharePoint,

    which provides Visual Studio project templates for

    building, debugging and deploying SharePoint

    projects and applications.The January community

    technology preview (CTP) of Visual Studio 2008

    Extensions for Windows SharePoint Services 1.3

    adds 64-bit support, refactoring support for

    renaming Web parts, and a command-line inter-

    face for enabling continuous integration and build.

    The final version is likely due in April, says PaulAndrew,Microsoft technical product manager for

    the SharePoint Developer Platform.

    Microsoft has been scaling up our guidance,

    and our application and tools, really, really fast,

    Andrew says, noting that Visual Studio 2010 will

    fully integrate SharePoint development support.

    Making the Transition

    Evidence of the effort to scale up guidance is

    evident in Web sites like Microsofts SharePoint

    Developer portal (http://tinyurl .com/bsx8k9)

    and the MSDN-hosted SharePoint Server (http://

    tinyurl.com/67e7gk)and Windows SharePoint

    Services (http:// tinyurl.com/7typk6)Developer

    Centers. The sites offer step-by-step tutorials,

    design patterns, best practices and other

    resources for developers working with the

    platform.

    Still, challenges remain.Veteran SharePointdevelopers complain that a lot of critical insight

    and guidance remains scattered among dozens of

    individual blogs and SharePoint-themed sites.

    My Google reader is filled with stuff I need

    to check on, but its all scattershot, says Ruther-

    ford Wilson,director ofproduct management for

    Atalasoft Inc., an ISV that in February released

    Vizit SP, an image-viewing application for MOSS

    and WSS environments.There are books,blogs,

    and thats about it.

    Ryan Thomas, director of the SharePoint

    practice at consultancy Syrinx Consulting Corp.,says developers new to SharePoint are best served

    by simply wading into the environment.

    The first thing I would do is build a Web

    part. Build and have Hello Worldworking in 30

    minutes. Then download the SDK and the object

    model. If youre going to be a developer, under-

    stand the object model and learn how to write

    code,he says.

    Thomas advises developers to visit the

    Microsoft CodePlex site to examine open source

    SharePoint projects similar to their own.

    He warns that seasoned .NET developers

    may find the dynamics around SharePoint devel-opment to be quite different from traditional

    .NET development. He says SharePoint projects

    tend to be client-facing, involving frequent and

    intense interaction with business stakeholders.

    Theres a good deal of expectation setting that

    must be addressed, in part because these users are

    often familiar enough with SharePoint to expect

    quick results.

    VPs, CIOs, business peoplethey just

    dont understand the concept of,three weeks and

    come back with code, Thomas says. Its very

    important to talk to them.

    Times are tough all over,but it seems somebody forgot to tell that tothe growing ranks of SharePoint developers. Even as general IT

    and development budgets turn south, industry watchers say

    the amount of activity around SharePoint applications and features

    continues to rise.

    VisualStudioMagazine.com March 2009 VISUAL STUDIO MAGAZINE 13

    http://tinyurl.com/bsx8k9http://tinyurl.com/67e7gkhttp://tinyurl.com/67e7gkhttp://tinyurl.com/7typk6http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://tinyurl.com/7typk6http://tinyurl.com/67e7gkhttp://tinyurl.com/67e7gkhttp://tinyurl.com/bsx8k9
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    16/44

    S H A R E P O I N T

    Tale of the Tools

    One of the enduring complaints about

    SharePoint development has centered around

    tooling. That situation is now changing,thanks in large part to the release of the Visual

    Studio extensions for SharePoint and useful

    utilities like the SPDisposeCheck tool for

    releasing unused memory. Still, major gaps

    remain in the SharePoint developer chain.

    The extensions are weak, in my opin-

    ion, writes Spencer Harbar, a U.K.-based

    independent SharePoint developer and

    frequent speaker at Microsoft conferences,

    in an e-mail interview. At best the exten-

    sions are a Band-Aid to bridge the gap

    between where we are now, and the future of

    SharePoint dev tools.Harbar says the extensions fall short

    for enterprise development, which can

    expose weaknesses and flaws in the tooling.

    He adds that the integrated SharePoint tool-

    ing in Visual Studio 2010 (VS10) should be

    much better. I cannot speak much to the

    VS10 tools without breaking NDAs, but I

    have complete confidence that they will

    offer a huge step change in terms of devel-

    oper tools for SharePoint,he says.

    Another issue is the fact that Share-

    Point environments must run on WindowsServera nagging issue for developers who

    prefer to code on their Windows XP or Vista

    workstations. Microsofts Andrew says

    developers today have two choices: Either

    run Visual Studio on the same Windows

    Server OS that hosts SharePoint,or stand up

    a virtual machine that incorporates Win-

    dows Server and the target SharePoint envi-

    ronment. Most shops, he says, opt for the

    latter solution.

    Leading component maker Compo-

    nentOne LLC is among them. The company

    in January released CTP versions of itsSharePoint Web Parts line, which include

    map,chart and datagrid controls for Share-

    Point environments.

    You need to make sure you have access

    to a testing environment that is not your

    development machines, thats particularly

    important for SharePoint, says Dan Beall,

    product manager for ComponentOne.

    Sometimes you have to use remote debug-

    ging. Its not as fluid as debugging on a target

    machine,but one thing you can do is you can

    have your code write entries to SharePoint log

    THE SHAREPOINT TOOLBOX

    SharePoint provides an enormous amount offunctionality but can be challenging for new

    developers trying to deploy solutions to a

    server. Fortunately, there are several free Microsoft

    and third-party tools that can be used to create Web parts, site definitions, event

    receivers and more. Heres a quick rundown of a few timesaving tools that can

    significantly increase your productivity when building SharePoint applications.

    WSPBuilder

    WSPBuilder provides a nice way to build manifest.xml, .DDF and .WSP solution files

    quickly and easily from the command line or through a Visual Studio add-in. It

    traverses a 12 folder structure in VS and generates the appropriate files needed to

    deploy a solution. It can be downloaded fromwww.codeplex.com/wspbuilder.

    STSDev

    STSDev can be used to build different SharePoint components such as Web parts and

    features more easily. Once a project type is selected (note that C# is currently the

    only supported language), it will create a VS 2005 or 2008 project automatically

    with the necessary SharePoint files and folder structure. STSDev can be down-

    loaded fromwww.codeplex.com/STSDev.

    CAML Query Builder

    Collaborative Application Markup Language (CAML) can be challenging to build from

    scratch. Fortunately, U2U has released a free tool called CAML Query Builder that can

    be used to build CAML queries visually without having to know a lot about CAML. It

    will output the proper CAML syntax for use with objects such as SPSiteDataQuery.CAML Query Builder can be downloaded fromhttp://tinyurl.com/9f5ulo.

    Business Data Catalog Definition Editor

    The Business Data Catalog (BDC) allows external data to be integrated into Share-

    Point that can be bound to built-in MOSS Web Parts or custom controls. To use BDC

    functionality you create custom .XML metadata files that define connection informa-

    tion, queries to execute, plus much more. Although the tool isnt as flexible to work

    with as some of the other tools out there, the price cant be beat. Its part of Share-

    Point 2007s SDK 1.2 release. Read more about it at http://tinyurl.com/cpot8a.

    Visual Studio Extensions for SharePoint

    Microsoft has released extensions for VS 2005 and 2008 that can simplify the

    process of building and deploying List items, Web Parts, Site Definitions and more. Atpress time version 1.3 for VS 2008 was released as a community technology pre-

    view. Additional information can be found at http://tinyurl.com/9qo9s8.

    SPDisposeCheck

    Unwary SharePoint developers can easily run into a situation where COM-based

    memory doesnt get released by CLR garbage collection. The resulting memory leak-

    age can cripple performance and cause unexpected crashes and failures. The

    Microsoft SharePoint Dispose Checker Tool, known as SPDisposeCheck, analyzes

    custom compiled assemblies so developers can ensure proper disposal of unused

    resources. Check it out here: http://tinyurl.com/dhn69w.

    Dan Wahlin

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com14

    http://www.codeplex.com/wspbuilderhttp://www.codeplex.com/STSDevhttp://tinyurl.com/9f5ulohttp://tinyurl.com/cpot8ahttp://tinyurl.com/9qo9s8http://tinyurl.com/dhn69whttp://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://tinyurl.com/dhn69whttp://tinyurl.com/9qo9s8http://tinyurl.com/cpot8ahttp://tinyurl.com/9f5ulohttp://www.codeplex.com/STSDevhttp://www.codeplex.com/wspbuilder
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    17/44

    http://www.microsoft.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    18/44

    S H A R E P O I N T

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com16

    files.There are a couple of freeware tools for looking at whats in the

    log files.

    SharePoint developers have come to rely on a growing collection

    of freely available tools and utilities to help them address the extended

    tool chain. Microsoft utilities, like the SPDisposeCheck tool, help

    stamp out troubling memory leakage conditions that can occur with

    unmanaged component code,while the CAML Query Builder eases

    the learning curve around SharePoints Collaborative Application

    Markup Language (CAML).The result:Many dev shops have assem-

    bled ad hoc tool chains to address the unique demands of SharePoint

    coding. (See The SharePoint Toolbox,p.14.)

    The SharePoint Way

    Ultimately, .NET developers face a subtle challenge in adjusting

    to life with SharePoint. .NET and ASP.NET developers working

    with SharePoint must be ready to do things the SharePoint way,

    says Anne Thomas Manes,v ice president and research director at

    Burton Group.

    SharePoint presupposes a bunch of design patterns and you

    kind of have to build your application around those design pat-

    terns, she says. And if you want your own design pattern, its

    probably not worth the time and effort. Dont attempt to force

    fit other design patterns into it, because it will just be a very frus-

    trating experience.

    Andrew draws a parallel with ASP.NET programming proj-

    ects,where developers typically start off by building a framework to

    address administration, security, data access and other issues.SharePoint,he says, essentially acts as the framework.

    That has the advantage that if you take a SharePoint develop-

    er, they already know that framework, they dont have to learn a

    new framework,he says.

    The problem is that the SharePoint framework is so large that

    Theres a lot of features in WSS that Microsoft doesntreally advertise to the rest of the world.

    Anne Thomas Manes, Vice President and Research Director, Burton Group

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.rally.com/http://www.visualstudiomagazine.com/http://www.rally.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    19/44

    S H A R E P O I N T

    developers often create custom code for features that are already

    there. Harbar urges developers to look carefully before concluding

    that a custom Web part or application is necessary.

    Easily the most common mistake is not having a core under-standing of the product architecture and therefore choosing the

    wrong approach to meet specific business requirements.SharePoint is

    such a huge platform that its incredibly easy to start implementing

    custom code for a task that SharePoint does,Harbar writes.

    He adds that developers often make the mistake of assuming

    that SharePoint is just .NET, when in fact .NET developers face a

    significant ramp in mastering SharePoint dev projects.

    Even within the SharePoint family there are choices to be

    made. Manes says that many enterprises today opt to develop for

    SharePoint Server, when they could achieve similar results and

    enjoy a more manageable environment by deploying logic to

    Windows SharePoint Services (WSS) instead. She says organiza-

    tions often concludewronglythat WSS lacks the features theyneed to support workflow, coordination, scheduling and other

    common business processes.

    There are a lot of features in WSS that Microsoft doesnt

    really advertise to the rest of the world, Manes says.I can use a

    Java portlet and have that be the interface into WSS,because that

    works through the Web services interface as opposed to the .NET

    interface.

    Ultimately, Microsofts Andrew says that .NET developers

    must learn to unlearn some of their old assumptions when movingto SharePoint.

    One of issues is people taking the approachand this happens

    because projects need to be done fastthat their .NET experience

    will get them through their SharePoint project,Andrew says.They

    do have to learn new skills. VSM

    Michael Desmond ([email protected])is editor in chief of

    Visual Studio Magazine.

    GO ONLINE

    Use this Locator+ code at VisualStudioMagazine.comto go directly to these

    related resources.

    READ

    VS0903MD Read this article online, which includes more information about

    how SharePoint adoption is raising data-management concerns; plus a Q&A

    with SharePoint development trainer and VSM online columnist Dan Wahlin.

    PERFECTION IN SOFTWARE PROTECTION

    Exceptional Software Protection

    CodeMeter for .NET

    Order your Free Software Development Kit now!

    Phone 1-800-6-GO-WIBU | [email protected]

    Access Protection

    Document Protection

    Software Protection

    Media Protection

    More than 1000 Key-Storage License Entries- Different ISVs can share one dongle

    Secure Expiration Date with a Real-Time-Clock- Unique Time Certification Feature- Control Relative and/or Absolute time

    More ways to sell = More salesCreate Student and Version Licenses

    Control Network Licensing- Control concurrent users- Control roaming users

    Create Standby Licenses- Hot Standby and Cold Standby- Provide Overflow Licenses

    Pay-Per-Use Counter

    twork Licensing

    WIBU-SYSTEMS USA Inc.110 W Dayton Street,Edmonds, WA 98020United [email protected]

    PERFECTION IN SOFTWARE PROTECTION

    VisualStudioMagazine.com March 2009 VISUAL STUDIO MAGAZINE 17

    mailto:[email protected]://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.wibu.com/http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/mailto:[email protected]://www.wibu.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    20/44

    B U I L D I N G C U S T O M T O O L S

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com18

    Youre already using a custom tool every

    time you add a dataset to an application.VS setsthe CustomTool property of the datasets .XSD to

    MSDataSetGenerator. Whenever you close the

    .XSD fileor, in Visual Studio 2008 (VS 2008),

    whenever you switch away from the fileVS

    passes MSDataSetGenerator the contents of the

    .XSD file,which MSDataSetGenerator then con-

    verts to code for the .XSDs code file and hands

    back to Visual Studio.

    You can design your own input format and

    write your own custom tool to generate code for

    you.Once you build your custom tool,you simply

    have to enter its name in the CustomTool property

    of the file with your input. VS takes care of the

    rest (see Figure 1,opposite page).Using a tool to generate repetitive code

    ensures consistency and reliability. It guarantees

    that your code generates the same way every

    time,reducing the amount of testing you have to

    do. Using a custom tool can also make you more

    productive,provided that entering the specifica-

    tions is faster than writing the code.If you decide

    you need to enhance your generated code, just

    modify your custom tool to incorporate your

    insights.Your class will be regenerated automati-

    cally with the new version of the code the next

    time you build your project.

    Youre writing the same code over and over again with only

    minor changes,and youre about to do it again. Stop. If youre

    creating a standalone class (either a class that youll call from

    your applications code or a class that you can inherit from),build a custom

    tool that writes the code for you now and every time youll need it.TECHNOLOGY TOOLBOX

    F E A T U R E

    Create a custom tool to provide a flexible and easy way

    to generate code on demand. BY PETER VOGEL

    Generate Code

    fromCustomFile Formats

    VB.NET

    C#

    SQL Server

    ASP.NET

    XML

    Other:

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    21/44

    B U I L D I N G C U S T O M T O O L S

    Installing to the GAC Automatically

    Creating a custom tool (also called a single file generator) pres-

    ents one problem.VS is a Windows application that calls a custom

    tool directly, so your custom tool must integrate with Windows and

    COM.You can create your custom tool in .NET,but you must make

    your tool available from Windows.

    To enable VS to call your tool,you must register it with Windows,

    add at least one registry key to let VS know your custom tool exists,

    and install your tool in the Global Assembly Cache (GAC). This

    means you must give your DLL a strong name. The good news is

    that you can configure VS so that all of these operations happen

    every time you compile your application.More good news:Most ofthe support for creating a custom tool is boilerplate and is identical

    from one custom tool to another.You only have to write it once and

    then copy and paste it to any other tool you create.

    You can build a custom tool in a variety of ways. I use the

    Microsoft.VisualStudio.Shell.Interop.IVsSingleFileGenerator and

    Microsoft.VisualStudio.OLE.Interop.IObjectWithSite interfaces. To

    create a custom tool,begin by creating a class library in the language of

    your choice and then add to it references to the Microsoft.VisualStu-

    dio.OLE.Interop and Microsoft.VisualStudio.Shell.Interop libraries.

    Next,configure your project to have VS call the gacutil utility to

    put your DLL in the GAC after your application compiles.First, find

    the full path to wherever gacutil.exe is installed on your computer.In

    VS,open the Project Properties for your application.If youre working

    in Visual Basic,select the Compile tab and click on the Build Events

    button. If youre working in C#, simply select the Build Events tab.

    Add these lines to the PostBuild event textbox (replace with the path to your copy of gacutil.exe):

    "\gacutil.exe" -u "$(TargetName)"

    "\gacutil.exe" -i "$(TargetPath)"

    The first line (which uses the TargetName parameter) removes any

    existing version of your tool from the GAC.The second line (which

    uses the TargetPath parameter) installs the current version of your

    tool into the GAC.

    When I build a project,I sometimes get an error message that

    states Microsoft.VisualStudio.Shell.Interop is not registered for

    COM interop.This doesnt stop the project from building or inter-

    fere with the custom tool executing, so if you get that message,

    ignore it. However, to ensure that the PostBuild event script exe-

    cutes every time you recompile your DLL, set the dropdown list

    underneath the PostBuild textbox to When the build updates the

    project output.To install your project in the GAC successfully,you must gen-

    erate an .SNK file that holds a digital signature (a strong name).Go

    to the Signing tab and check the Sign the assembly option. From

    the dropdown list you just enabled, select to display the

    Create a Strong Name Key dialog. Enter a valid file name in the Key

    file nametextbox.The resulting file can be read with Notepad,so if

    you want to ensure that no one but you has access to the file, enter a

    password in the dialog; if youre not worried about that, then

    uncheck the password option before clicking on the OK button.

    Integrating with Windows and COM

    The next step is to configure your project to have your DLL regis-

    tered with COM/Windows every time you build it. Still in ProjectProperties, find the Register for COM interopcheckbox on the

    Build tab (for C#) or Compile tab (for Visual Basic) and check it.

    Youll need to revisit this option if you change the projects configu-

    ration setting (for example,if you switch from Debug to Release),

    because the option is cleared when the configuration changes. As

    part of supporting COM, you also must go to the Application tab

    and click on the Assembly Information button. Check the Make

    assembly COM-Visibleoption on the resulting dialog.

    Your custom tool must implement two interfaces: IVsSingle-

    FileGenerator and IObjectWithSite. You must assign your class a

    unique GUID to identify it to Windows.Simply add a System.Run-

    time.InteropServices.Guid attribute to your class and pass it a

    FIGURE 1 Code-Generation Output The CodeGenerationInput.xml

    file has had its custom tool property set to SiteProcessor.

    When you switch away from the file, the SiteProcessor custom

    tool produces the code that Visual Studio put in the CodeGenera-

    tionInput.Generated.cs file.

    Using a tool to generate repetitive code

    ensures consistency and reliability.

    VisualStudioMagazine.com March 2009 VISUAL STUDIO MAGAZINE 19

    http://www.visualstudiomagazine.com/http://www.visualstudiomagazine.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    22/44

    BeTheDataGuru

    Visual Studio WPF/Silverlight SharePoint SQL Server PowerShell Java CO M

    http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    23/44

    Data visualization for every need, every platform

    Our most popular product, Chart FXprovides

    charts, gauges and maps with additional vertical

    visualization functionality for business intelligence

    (OLAP), geographic data, financial technical

    analysis, and statistical studies and

    formulas. Recognized as the innovatorand leader of the charting component

    category for the past 15 years, Chart FX

    delivers incomparablegallery options,

    aesthetics and data analysis features.

    Grid FXwas specifically designed for visual studio

    developers to take advantage of a powerful

    design-time experience, integrated Chart FX

    functionality right in the box, and AJAX to

    provide robust, run-time functionality in ASP.net

    applications. The dynamic aesthetic features

    for data presentation and analysis allow simple

    adaptation to an existing application or tospecific

    corporate branding guidelines.

    PowerGadgetsputs powerful IT monitoring

    on your desktop and in your data sidebar.

    IT professionals can now create gadgets

    that consume data from WMI, Exchange,

    SQLServer andeven theWindowsRegistry.

    PowerGadgets does not require any

    development environments,servers or

    browsers to run real-time gadgetcomponents

    such as charts, gauges and maps.

    To master the art of data visualization, you must seek out the leader. For almost two decades,

    Software FX has risen above all others by bringing top-of-the-line data visualization tools to

    enterprise developers working with diverse markets, platforms and environments. This

    wisdom has evolved into a vast body of products, including a data presentation tool that

    provides a best-of-breed solution for Windows developers seeking enterprise quality and

    performance, as well as a professional IT monitoring solution offering incredible features for

    reporting and monitoring data. For a world of data visualization products that can raise your

    work to a higher level, depend on the source thats clearly on top.

    AchieveAHigherStateOfDataVisualization

    Visit softwarefx.com for interactive demos and more information about our latest products.

    http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/http://www.softwarefx.com/
  • 8/10/2019 Visual Studio Magazine - 03- 2009.pdf

    24/44

    B U I L D I N G C U S T O M T O O L S

    VISUAL STUDIO MAGAZINE March 2009 VisualStudioMagazine.com22

    GUID. In VS 2008, you can generate a GUID by selecting Create

    GUID from the Tools menu. In VS 2005, open the VS Command

    window and run the guidgen utility.Both methods open the Create

    GUID dialog. Regardless of how you start the tool,pick option 4 to

    generate a GUID compatible with the Guid attribute (the result will

    be enclosed in braces that youll need to delete after pasting the

    GUID into your code).

    Once youre done,your class declaration will look like this in

    Visual Basic:

    _

    Public Class TextGenerator

    Implements _

    Microsoft.VisualStudio.Shell.Interop. _

    IVsSingleFileGenerator

    Implements Microsoft.VisualStudio.OLE.Interop. _

    IObjectWithSite

    For VS to know about your custom tool, you need to add at least one

    key to the Windows registry.The easiest way to do this is to add two

    methods to your application:one to add the key and one to delete it.With the right attributes on those methods,they will be called auto-

    matically when your custom tool is registered or deregistered with

    Windows.(The changes you make to your project ensure that your

    tool is registered and deregistered each time you build it.)

    The code in these two methods is mostlybut not completely

    boilerplate.You need to specify the version ofVS that the custom tool

    works with,provide a GUID that identifies the language of the projects

    that your tool will work with, provide the name youll use in the Cus-

    tomTools property and give a description. In addition, you have to

    copy the GUID you generated f